I have 3 divs:
This will work both if div one is higher then div two and the opposite (with jQuery) and will also be fired every time you resize the window (for fluid layouts):
resize_objects();
$(window).resize(resize_objects);
function resize_objects(){
var $a = $('#one').height(), $b = $('#two').height();
if($a > $b) {
//#one is higher than #two
$("#two").css("height",$a);
}
else {
//#two is higher than #one
$("#one").css("height",$b);
}
}