function item(name, title, size, cena, data, english, width,height, video)
{
	this.name = name;
	this.title = title;
	this.size = size;
	this.cena = cena;
	this.data = data;
	this.english = english;
	if (english == null)
		this.english = title;
	this.width = width;//real image width
	this.height = height;//real imahe height
	this.cached = null;//cached Image object
	this.sub = null;//sub-treeNode
	this.video = video;
}

function canGoBack(elements)
{
	if (this.currentItem - elements + 1 > 0)
	{
		return true;
	}
	return false;
}

function go(index)
{
	this.currentItem = index;
	return this.current();
}

function canGoForward(elements)
{
	if (this.currentItem + elements < this.nodes.length)
	{
		return true;
	}
	return false;
}

function goForward(elements)
{
	if (this.canGoForward(1) == true)
	{
		this.currentItem += elements;
		if (this.currentItem >= this.nodes.length)
		{
			this.currentItem = nodes.length - 1;
		}
		return this.current()
	}
	return null;
}

function goBack(elements)
{
	if (this.canGoBack(1) == true)
	{
		this.currentItem -= elements;
		if (this.currentItem < 0)
		{
			this.currentItem = 0;
		}
		return this.current()
	}
	return null;
}

function current()
{
	if (this.currentItem < this.nodes.length)
	{
		return this.nodes[this.currentItem];
	}
	return null;
}

function treeNode(nodes, parent)
{
	this.nodes = nodes;//array of items
	this.parent = parent;//parent treeNode
	this.currentItem = 0;
	this.canGoBack = canGoBack;	
	this.canGoForward = canGoForward;
	this.goForward = goForward;
	this.goBack = goBack;
	this.current = current;
	this.go = go;
}
	
