/**
 * @author wi3dzmin
 */
function Palette(PaletteId)
{
	this.InputObject;
	this.Palette = document.getElementById(PaletteId)
			
	this.view = viewPalette
	this.hide = hidePalette
	this.echo = echo;
	this.setColor = setColor;
}

function viewPalette(e, InputId)
{
	var X = e.clientX+document.body.scrollLeft;
	var Y = e.clientY+document.body.scrollTop;
			
	this.InputObject = document.getElementById(InputId);
	
	this.Palette.style.left = X + 20 + "px";
	this.Palette.style.top = Y - 30 +"px";
	this.Palette.style.visibility = "visible";
}
		
function hidePalette()
{
	this.InputObject = null;
	this.Palette.style.left = 0+"px";
	this.Palette.style.top = 0+"px";
	this.Palette.style.visibility = "hidden";
}	
		
function setColor(Color)
{
	this.InputObject.style.backgroundColor = "#"+Color;
	this.InputObject.value = Color;
}		
function echo()
{
	alert(this.InputObject);
}
