function Rightmenu(id)
{
	var self = this;
	this.rightmenu = document.getElementById(id);
	this.spanId = this.rightmenu.getElementsByTagName("span")[0];
	this.amenu = this.rightmenu.getElementsByTagName("a");
	this.colormenu = new Colormenu;
	this.uploader = new Fileuploader;
	
	this.rightmenu.onmouseover = function()
	{
		self.rightmenu.style.display = "block";
	}
	
	this.rightmenu.onmouseout = function()
	{
		self.rightmenu.style.display = "none";
	}
	
	for(var i=0 ; i < this.amenu.length; i++)
	{
	
		this.amenu[i].onmouseover = function(e)
		{
			if(self.card.mine)
			{
				this.className = "hover";
				switch(this.id)
				{
					case 'color':
						self.colormenu.displayMenu(self.card,e);
						break;
						
					default:
					break;
				}
			
			}
		}
		
		this.amenu[i].onmouseout = function()
		{
			this.className = "";
			self.colormenu.ul.style.display = "none";
		}
		
		this.amenu[i].onclick = function()
		{
			if(self.card.mine)
			{
				switch(this.id)
				{
					case 'delete':
						base.board.removeChild(self.card.div);
						base.cards.splice(self.card.id,1,null);
						break;
						
					case 'fileupload':
						self.uploader.display(self.card);
						break;
				
				}
			}
		}
	}
}

Rightmenu.prototype.displayMenu = function(card,e)
{
	if(!isMSIE)
	{
		this.card = card;
		this.spanId.childNodes[0].nodeValue = "#" + card.myId + card.id;
		this.rightmenu.style.left = e.pageX - 5;
		this.rightmenu.style.top = e.pageY - 5;
		this.rightmenu.style.display = "block";
	}else
	{
		this.card = card;
		this.spanId.childNodes[0].nodeValue = "#" + card.myId +  card.id;
		this.rightmenu.style.left = event.x  -5;
		this.rightmenu.style.top = event.y  -5;
		this.rightmenu.style.display = "block";
	}
}