//panel_photo_folder_viewer.js

function PanelPhotoFolderViewer(o)
	{
	if (o.thumbsFolderPath != undefined) 
		{
		o.windowPanel = this;
		this.folder = new Folder(o.thumbsFolderPath, PanelPhotoFolderViewer_Build, o);
		}
	}

//--------------------------------------------------------------------------
function PanelPhotoFolderViewer_Build(folder, o)
	{
	o.windowPanel.panel = new Panel({
		id: "gallery",
		title: "Picts: "+this.pictsFolderPath,
		top: o.top,
		left: o.left,
		height: 461,
		width: 101,
		backgroundColor: "black"
	});

	if (o.pictsFolderPath == undefined) this.pictsFolderPath = null;
	else this.pictsFolderPath = o.pictsFolderPath;

	o.windowPanel.grid = new Grid({
		parent: o.windowPanel.panel.div,
		top: 21,
		left: 0,
		height: 440,
		width: 100,
		fontColor: "green",
		cellCursor: "hand",
		pictFolder: folder,
		dragPictFolderPath: this.pictsFolderPath,
		dragArea: o.dragArea,
		selectRowHandler: SelectPhotoFunc
	});
	
	}
//--------------------------------------------------------------------------
function SelectPhotoFunc(grid, row)
	{
	var filename = grid.pictFolder.GetImageFileByIndex(row);
	if (grid.dragArea != undefined) grid.dragArea.obj.AddPictFile(grid.dragPictFolderPath+"/"+filename);
	}

