function interpr(val)
{
	var okn2 = window.open('interpr.php?id=' + val, 'win2', 'left=200,top=200,width=600,height=350,scrollbars=1,resizable=1');
	okn2.focus();
}
function bigimg(val, pw, ph)
{
	var okn = window.open(val, 'win', 'left=0,top=0,width=' + pw + ',height=' + ph + ',scrollbars=1');
	okn.focus();
}
function showInfo(val, type)
{
	var okn2 = window.open('desc.php?id=' + val + '&type=' + type, 'win2', 'left=200,top=200,width=600,height=350,scrollbars=1,resizable=1');
	okn2.focus();
}
function topMenuOn(obj, val, pid)
{
	var styl = (obj.style) ? obj.style : obj;
	if (document.layers)
	{
		styl.background.src = 'images/topmenu' + val + '_on.gif';
	}
	else
	{
		styl.backgroundImage = 'url(images/topmenu' + val + '_on.gif)';
	}
	if (document.images && document.images['topm0' + pid]) document.images['topm0' + pid].src = 'images/topmenu2_on.gif';
}
function topMenuOff(obj, val, pid)
{
	var styl = (obj.style) ? obj.style : obj;
	if (document.layers)
	{
		styl.background.src = 'images/topmenu' + val + '.gif';
	}
	else
	{
		styl.backgroundImage = 'url(images/topmenu' + val + '.gif)';
	}
	if (document.images && document.images['topm0' + pid]) document.images['topm0' + pid].src = 'images/topmenu2.gif';
}

function loadDamagedImages()
{
	var isOK = true;
	var ile = document.images.length;
	for (i = 0; i < ile; i++)
	{
		if (!document.images[i].complete)
		{
			isOK = false;
			var img = new Image();
			img.src = document.images[i].src;
			document.images[i].src = '';
			document.images[i].src = img.src;

			var myImg = document.images[i].src.substring(document.images[i].src.length - 17);
			var myImg2 = document.images[i].src.substring(document.images[i].src.length - 18);

			if (document.getElementById && document.getElementById("mn1") && document.getElementById("mn1").background)
			{
				var j = 0;
				while (document.getElementById("mn" + j))
				{
					if (document.getElementById("mn" + j).background == myImg)
					{
						document.getElementById("mn" + j).background = '';
						document.getElementById("mn" + j).background = myImg;
					}
					else if (document.getElementById("mn" + j).background == myImg2)
					{
						document.getElementById("mn" + j).background = '';
						document.getElementById("mn" + j).background = myImg2;
					}
					j++;
				}
			}
		}
	}
	if (isOK)
	{
		clearInterval(preloadInterval);
		window.status = 'All images are loaded.';
	}
}
