function window_popup(href, target, width, height, type)
{
	var left	= 0;
	var top		= 0;
	var opts	= '';
	
	if (screen.width > width) 
		left = (screen.width - width) / 2;
		
	if (screen.height > height)
		top = (screen.height - height) / 2;
		
	opts="toolbar=no, directories=no, menubar=no, resizable=no, scrollbars=no, width=" + width + ", height=" + height + ", left=" + left + ", top=" + top;

	popup_window = window.open(href, target, opts);
	
	if (type == "popunder")
	{
		popup_window.blur();
		window.focus();
	}
	
}

function image_popup(a)
{
	window_popup(a.href, a.target, 800, 600, "popup");
}



//--------
if (popup)
{
	window_popup("/popup.php?n=" + popup_id + "&amp;lang=" + popup_language, "popup", popup_width, popup_height, popup_type);
}



//--------
var anchors = document.getElementsByTagName('a');

for (var i = 0; i < anchors.length; i++)
	if (anchors[i].className.indexOf('image_popup') != -1)
		anchors[i].onclick = function() { image_popup(this); return false; };

		
		
//--------
var recommend = document.getElementById('recommendPopup');

if (recommend)
{
	recommend.onclick = function () {window_popup(recommend.href, recommend.target, 400, 300, "popup"); return false; };
}