addListenerToEvent(window,'onload','matchHeight_featured()');

/* 
div-height equalizer from 
http://www.devarticles.com/c/a/Web-Design-Standards/Matching-div-heights-with-CSS-and-JavaScript/3/
note that it didn't work in FF because it wasn't setting the heights in pixels, just a number.
Modified just to equalise two divs that I pass to it.
*/
matchHeight_featured=function(){
	// initialize maximum height value
	var maxHeight=0;
	
	var divs=getElementsByClassName ('featured', 'div', document.getElementById('featured'));
	
	// iterate over specified elements to greatest height
	for(var i=0;i<divs.length;i++){
		//alert(divs[i]);
		d=divs[i];
		
		// determine height for <div> element
		if(d.style.height){
			//alert('style.height');
			divHeight=d.style.height;
			} // end else if
		else if(d.offsetHeight){
			//alert('offsetHeight');
			divHeight=d.offsetHeight;
			} // end if
		else if(d.style.pixelHeight){
			//alert('style.pixelHeight');
			divHeight=d.style.pixelHeight;
			} // end else if
		//alert('divHeight: '+divHeight);
		
		// calculate maximum height
		maxHeight=Math.max(maxHeight,divHeight);
		//alert('maxHeight: '+maxHeight);
		} // end for (args)
		
	//alert('final maxHeight: '+maxHeight);
	
	// assign maximum height value to all specified elements
	for(var i=0;i<divs.length;i++){
		//alert(divs[i]);
		d=divs[i];		
		d.style.height=maxHeight+'px';
		d.style.marginLeft='0px';
		d.style.height=maxHeight+'px';
		if (d.offsetHeight > maxHeight) { // fix for the difference between height and offsetHeight in standards-compliant mode (see http://www.paulbellows.com/getsmart/balance_columns/column.js)
				d.style.height = (maxHeight - (d.offsetHeight - maxHeight)) + 'px';
			}
		}

	}


