function displayImage(index)
{
	if (parent.mainFrame.ready)
	{
		parent.mainFrame.displayImage(index);
	}
	else
	{
		var funcname = "displayImage(" + index + ")";
		setTimeout(funcname, 100);
	}
}

function changeGallery(id, gid)
{
	document.location.href = "content.php?id=" + id + "&gid=" + gid;
}

var scroll = null;

function scrolllt()
{
	var frame = document.getElementById("thumbs");
	var doc = frame.Document;
	if (!doc)
	{
		doc = frame.contentDocument;
	}
	if (doc)
	{
		var win = doc.parentWindow;
		if (!win)
		{
			win = frame.contentWindow;
		}
		if (win)
		{
			win.scrollBy(6, 0);
		}
	}
	scroll = setTimeout("scrolllt()", 50);
}

function scrollrt()
{
	var frame = document.getElementById("thumbs");
	var doc = frame.Document;
	if (!doc)
	{
		doc = frame.contentDocument;
	}
	if (doc)
	{
		var win = doc.parentWindow;
		if (!win)
		{
			win = frame.contentWindow;
		}
		if (win)
		{
			win.scrollBy(-6, 0);
		}
	}
	scroll = setTimeout("scrollrt()", 50);
}

function scrollup()
{
	var frame = document.getElementById("thumbs");
	var doc = frame.Document;
	if (!doc)
	{
		doc = frame.contentDocument;
	}
	if (doc)
	{
		var win = doc.parentWindow;
		if (!win)
		{
			win = frame.contentWindow;
		}
		if (win)
		{
			win.scrollBy(0, 6);
		}
	}
	scroll = setTimeout("scrollup()", 50);
}

function scrolldn()
{
	var frame = document.getElementById("thumbs");
	var doc = frame.Document;
	if (!doc)
	{
		doc = frame.contentDocument;
	}
	if (doc)
	{
		var win = doc.parentWindow;
		if (!win)
		{
			win = frame.contentWindow;
		}
		if (win)
		{
			win.scrollBy(0, -6);
		}
	}
	scroll = setTimeout("scrolldn()", 50);
}

function stopscroll()
{
	clearTimeout(scroll);
	scroll = null;
}

