function Selector(data, id)
{
	this.data = data;
	this.id = id;
		
	this.FillDiv = function(divId)
	{
		var parent = document.getElementById(divId);
		parent.innerHTML = '';
				
		if (parent == null) return;
				
		var innerHtml = '';
				
		for(var i=0;i<data.Length;i++)
		{			
			var div = document.createElement("div");
			div.id="img"+i;
			div.className="selector-box";			
			div.setAttribute("ondblclick", "this.onclick()");

			var box = document.getElementById('box_image_title');
						
			if (box == null)
			{				
				var fn = this.id+'_click('+data.Keys[i]+
					', this.id)';
				
				div.onclick = new Function(fn);								
			}
			else
			{
				var fn = this.id+'_click('+data.Keys[i]+', this.id);'+
				"document.getElementById('box_image_title').value='"+data.Values[i]+"';";
				
				div.onclick = new Function(fn);				
			}				

			var div1 = document.createElement("div");
			div1.className="selector-image";
			var img = document.createElement("img");
			img.setAttribute("src", "reposit.php?action=10&id="+data.Keys[i]);
			img.setAttribute("alt", "");
			div1.appendChild(img);			
			
			var div2 = document.createElement("div");
			div2.className="selector-text";
			div2.innerHTML = data.Values[i];
			
			div.appendChild(div1);
			div.appendChild(div2);
			parent.appendChild(div);
		}		
	}
}
