function colorpicker()
{
	this.creategrid=function(el)
	{
		grid="";
		id = el.id;
		grid+='<table width="100%"><tr>';
		var a=0;
		for(x=0;x<255;x+=60)
		{
			for(y=0;y<255;y+=60)
			{
				for(z=0;z<255;z+=60)
				{
					if(a%15==0){grid+='</tr><tr>';}
					a++;
					grid+='<td class="colorpick" onclick="core.app.colorpicker.colorchosen(\'#'+core.effects.RGB2HTML(new Array(x,y,z))+'\',\''+id+'\')" style="background-color:#'+core.effects.RGB2HTML(new Array(x,y,z))+'"></td>';
				}
				
			}
			
		}
		
		grid+='</tr></table>';
		return grid;
	}	
	this.colorchosen=function(value,target)
	{
		if(value != "")
		{
			document.getElementById(target).value = value;
		}
		var cal = document.getElementById('col');
		document.getElementById('col').parentNode.removeChild(cal);
		document.getElementById('mask').style.display='none';
	}
	this.closecolor=function()
	{
		var cal = document.getElementById('col');
		if(!cal){return false;}
		document.getElementById('col').parentNode.removeChild(cal);
		document.getElementById('mask').style.display='none';
	}
}
