function matchHeight()
{
	var divs,contDivs,subContDivsLeft,subContDivsRight,maxHeight,subMaxHeight,divHeight,d;
	
	// get all <div> elements in the document
	divs=document.getElementsByTagName('div');
	contDivs=[];
	subContDivsLeft=[];
	subContDivsRight=[];
	
	// initialize maximum height value
	maxHeight=0;
	
	// iterate over all <div> elements in the document
	for(var i=0;i<divs.length;i++)
	{
		// make collection with <div> elements with class attribute 'container'
		if(/\bcontainer\b/.test(divs[i].className))
		{
			d=divs[i];
			contDivs[contDivs.length]=d;
			
			// determine height for <div> element
			if(d.offsetHeight)
			{
				divHeight=d.offsetHeight;
			}
			else if(d.style.pixelHeight)
			{
				divHeight=d.style.pixelHeight; 
			}
			
			maxHeight=Math.max(maxHeight,divHeight);
		}
		
		if(/\bsubcontainerLeft\b/.test(divs[i].className))
		{
			d=divs[i];
			subContDivsLeft[subContDivsLeft.length]=d;
			subMaxHeightLeft = d.offsetTop;
		}

		if(/\bsubcontainerRight\b/.test(divs[i].className))
		{
			d=divs[i];
			subContDivsRight[subContDivsRight.length]=d;
			subMaxHeightRight = d.offsetTop ;
		}
	}
	
	// assign maximum height value to all of container <div> elements
	for(var i=0;i<contDivs.length;i++)
	{
		contDivs[i].style.height=maxHeight + "px";
	}
	
	//set the height of the left and right content boxes
	subContDivsLeft[0].style.height= 63+(maxHeight - subMaxHeightLeft) + "px";
	subContDivsRight[0].style.height= 63+(maxHeight - subMaxHeightRight) + "px";
	
	//realign the "Top" link to be at the bottom of the content
	if(document.getElementById('mainContent'))
	{
		var rem;
		rem = 200 + document.getElementById('mainContent').offsetHeight - document.getElementById('top').offsetTop;
		document.getElementById('top').style.top = rem + "px";
	}
}

