function handleSidebarAdvert() 
{
	var adColumn = findObj("sidebar");
	// expand if the ad column isn't in the page, or if there is no image.
	if (adColumn == undefined || adColumn.offsetWidth < 30) // just in case the no-image placeholder is showing
	{	
		if(document.createStyleSheet) 
		{
			document.createStyleSheet('http://'+window.location.host+'/css/nosideadvert.css');
		}
		else
		{
			var styles = "@import url('http://"+window.location.host+"/css/nosideadvert.css ');";
			var newSS = document.createElement('link');
			newSS.rel = 'stylesheet';
			newSS.href = 'data:text/css,'+ escape(styles);
			document.getElementsByTagName("head")[0].appendChild(newSS);
		}
	}	
}

function findObj(n, d)
{
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=a8FindObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
