/* CMS-based site/PFIZER UK
*  Author: Lucy Barker, DNA an AvenueA|Razorfish company
*  equalheights.js
*/

// nb: this approch works more consistently x-browser than mootool Fx object commands, so far...
function equalHeight() {
// equal height between elements in #hub-footer (knowQ shorter than promoQ)
	if ($('knowQ') != null && $('knowQ').offsetHeight < $('promoQ').offsetHeight) $('knowQ').style.height = ($('promoQ').offsetHeight - 21) + 'px';

	// left navigation border calculation
	if ($('nav-secondary') != null && $('nav-secondary').offsetHeight < $('main').offsetHeight) {
		var nse = $('nav-secondary-end').offsetHeight - 26;
		var ns = $('nav-secondary').offsetHeight - 28;
		$('nav-secondary').style.height = ($('main').offsetHeight - nse) + 'px';
		$('nav-secondary-end').style.height = ($('main').offsetHeight - ns) + 'px';
	}	
}

window.addEvent('load', function() {
	equalHeight();
});
