
<!-- .js code required on pages with ads -->


function recenter(offset)
{
	if (!document.layers || !document.layers.imgAd)
		return;
	
	if (offset == -1)	
		offset = (parent.innerWidth - 468) / 2;
	
	document.layers.imgAd.moveToAbsolute(document.ph1.pageX +
		offset, document.ph1.pageY);
}


function openPopupAd(url, windowName, width, height, margin, isLeft)
{
	var popupX = 20;
	var popupY = 20;

	if (window.screen != null)
	{
		if (isLeft)
		{
			popupX = margin;
		}
		else
		{
			popupX = window.screen.availWidth - margin - width;
		}
		popupY = window.screen.availHeight - margin - height;
	}
	
	var features =
		"screenX=" + popupX +
		",left=" + popupX +
		",screenY=" + popupY +
		",top=" + popupY +
		",width=" + width +
		",height=" + height +
		",toolbar,scrollbars,resizable,status,menubar,location,directories";
		
	window.open(url, windowName, features, true);
}
