function AR_LoadOverlay(id, alias)
{
	document.getElementById('overlay').style.display='block';
	margin = (window.innerWidth-900) / 2;
	//document.getElementById('overlay').style.marginLeft=margin+'px';
	
	if (whichBrs() == 'Internet Explorer')
	{
		height = (document.documentElement.clientHeight-4);
		width = (document.documentElement.clientWidth-4);
	}
	else
	{
		height = (window.innerHeight-4);
		width = (window.innerWidth-4);
	}
	
	
	
	document.getElementById('overlay').style.width=width+'px';
	document.getElementById('overlay').style.height=height+'px';
	
	url = '/plugins/ads/configure.php?id='+id+'&alias='+alias+"&width="+width+"&height="+height;
	
	new Ajax.Updater('overlay', url);
	
	document.getElementById('page_container').style.display='none';
}

function AR_RelayComplete()
{
	document.getElementById('overlay').style.display='none';
	document.getElementById('page_container').style.display='block';
	
	loc = document.getElementById('loc').value;
	container = 'content_' + loc; 
	
	new Ajax.Updater(container, '/plugins/ad_relay/reload.php?container='+loc);
}

function AR_Close()
{
	document.getElementById('overlay').style.display='none';
	document.getElementById('page_container').style.display='block';
}

function AR_Refresh()
{
	alert('Done');
}
