//
// MapToolbar Class
// (Fungo's map toolbar)
//
var MapToolbar = Class.create
({
	initialize: function(id, map)
	{
		this.id = id;
		this.map = map;
		this.buttons = Array();
		

		this.PrintBox();
	},
	
	Addbutton: function()
	{
		
	},
	
	OpenClose: function()
	{
		if(this.stat == 0)
		{
			this.stat = 1;
			new Effect.BlindDown(document.getElementById(this.icons.id), {duration:0.5});
		}
		else
		{
			new Effect.BlindUp(document.getElementById(this.icons.id), {
				duration: 0.5
			});
			this.stat = 0 ;
		}


		//alert(this.stat);
	},
	
	PrintBox: function()
	{
		this.fatherMapDIV = document.getElementById( this.map.id );
		this.box = document.createElement('div');
		this.box.id = this.id;
		this.box.innerHTML = "<br>";//"<a id='"+this.id+"OpenClose'  ><img  src='Classes/GUI/JavaScript/lib/MapClasses/img/tools.png'/></a><br><br><br>";
		this.box.style.position ='relative';
		this.box.style.backgroundColor = "white";
		this.box.style.font = "small Arial";
		this.box.style.opacity =".75";
		this.box.style.textAlign = "center";
		this.box.style.width = "50px";
		this.box.style.cursor = "pointer";
		this.box.style.marginTop = 0;
		this.box.style.marginLeft = this.fatherMapDIV.offsetWidth-50;
		//this.box.style.height = "200px";
		
		this.fatherMapDIV.appendChild(this.box);
		

		this.PrintIcons();
		
		//add event for desplegator
		//Event.observe(this.id+"OpenClose", "click", this.OpenClose, false);
	},
	
	
	PrintIcons: function()
	{
		// Create icons container

		this.picons = document.createElement('div');
		this.picons.id = "PermanentIconBar";
		this.picons.style.visibility='visible';
		this.box.appendChild(this.picons);
		
		this.icons = document.createElement('div');
		this.icons.id = "IconBar";
		this.icons.style.visibility='visible';
		this.box.appendChild(this.icons);
		
	},
	
	AddIcons: function(btnID, imgSRC)
	{
		this.icons.innerHTML = this.icons.innerHTML + "<img id='" + btnID +"' src='" + imgSRC + "' label='Obra'/><br><br>";
	},
	
	AddPermanentIcons: function(btnID, imgSRC)
	{
		this.picons.innerHTML = this.picons.innerHTML + "<img id='" + btnID +"' src='" + imgSRC + "' label='Obra'/><br><br>";
	},
	
	
	Descripcion: function()
	{
		alert('');
	}
	
});

