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);
}


/* code for table rollovers */

//SWAP CLASS(element object, classname)
function sC(elm,cn)
{
	if(!elm){return;}
	elm.className = cn;
}
//FIND LINK AND GO(element object [, target, linkid])
//target	- optional, "_self" by default, ie the same window
//lnkid		- optional, the value of the id attribute within an A element inside the element object
//			  if not specified, the script will attempt to find a the first A element with an href
//			  attribute inside the element object
function fLaG(elm,trgt,lnkid)
{
	if(!elm){return;}

	var t = "_self";
	if(trgt){t=trgt;}

		var a;
		if(lnkid){a=document.getElementById(lnkid);}
			else
			{
			var l = elm.getElementsByTagName('A');
			if(l)
			{
				for(var i=0;i<l.length;i++)
			{
				if(l[i].href){a = l[i];break;}
			}
		}
	}
		if(a)
	{
		if(a.href){window.open(a.href,t);}
		else{return;}
	}
	else{return;}
}




