
win = null;

function openWin(url,str,x,y)
{
	if(x<=0) var x = 500;
	if(y<=0) var y = 500;

	var mytop=(screen.height/2) - (y/2);
	var myleft=(screen.width/2) - (x/2);

	if(win)
	{
		win.close();
	}
		
	//win = window.open('../../_pop.php?img=' + escape(url) + '&x=' + x + '&y=' + y, 'help', 'width='+x+',height='+y+',top=' + mytop + ',left=' + myleft + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	win = window.open(url + '?&x=' + x + '&y=' + y, 'help', 'width='+x+',height='+y+',top=' + mytop + ',left=' + myleft + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	win.focus();
}

function setWindow()
{
	closeMenu();
	IEMaxHeightFix();
}

function IEMaxHeightFix()
{
	try
	{
		var o = document.getElementById('content');
		var h = o.currentStyle.minHeight;
		
		if(o.offsetHeight < parseInt(h))
		{
			o.style.height = h;
		}
	}
	catch(e)
	{
		// currentStyle = IE only		
	}
}

function swapImage(mode, id)
{
	var img = document.getElementById('portfolio-img-' + id);
	var src = mode ? im[id].src : im[id].src.replace(/\.png/, "_1.png");
	
	if(img.tagName.toLowerCase() == 'span')
	{
		// IE - PNG FIX
		img.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + src + ', sizingMethod="scale")';
	}
	else
	{
		img.src = src;
	}
}

function openLogBlock(id)
{
	var o = document.getElementById('logextra' + id);
	
	try
	{
		o.style.display = o.style.display != 'table-row' ? 'table-row' : 'none';
	}
	catch(e)
	{
		o.style.display = o.style.display != 'block' ? 'block' : 'none';
	}
}

function toggleElement(id)
{
	var el = document.getElementById(id);
	el.style.display = el.style.display != 'block' ? 'block' : 'none';
}

