function swCN(me,cn){me.className=cn;}

function sv(me,v,cmp)//set value (element, value, compare)
{
	if(cmp)
	{
		if(cmp != me.value){return;}
	}

	me.value = v;
}

function ge(i){return document.getElementById(i);}

function sizeBody()
{
	var b = ge('dBody');

	var curH = b.offsetHeight;
	var padH = 10;//padding
	var newH = -1;

	var minH = 0;//height of tower + 27px top and bottom

	var elmH = 0;

	for(var i=0;i<b.childNodes.length;i++)
	{
		elmH = divH(b.childNodes[i]);
		if(elmH > newH){newH = elmH;}
	}

	newH += (padH*2);//*2 for top and bottom

	if (newH < minH) { newH = minH; }

	if(newH > curH){b.style.height= newH + 'px';}
}

function divH(elm)
{
	var th = -1;//total height

	if(elm)
	{
		if(elm.nodeType==1)
		{
			
			var ot;//offset top
			var oh;//offset height
			
			ot = parseInt(elm.offsetTop,10);
			oh = parseInt(elm.offsetHeight,10);
			th = parseInt(ot+oh,10)
		}
	}

	return th;
}

//##################################
// FROM PREVIOUS JS
//##################################

var dm = new String('http://' + location.hostname + '/');
var refer = new String(location.href);
function taf(){window.open(dm + 'tellafriend.htm?h1=' + document.getElementsByTagName('h1')[0].innerText + '&refer=' + refer,null,'height=120,width=740,resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no');}

//##################################
if (window.addEventListener)
{
	window.addEventListener('load', sizeBody, false); 
}
else if (window.attachEvent)
{
	window.attachEvent('onload', sizeBody);
}