Equal heights column script

I would like to write my own equal height column script and think I have the right idea but am kinda lost. Can someone help me out. Help think about what I need to do here. I am trying to learn jquery.
Here is my code so far:

var $coldblheight = jQuery(‘#col_double’).height();
var $colsnglheight = jQuery(‘#col_single’).height();

if($coldblheight > $colsnglheight){
	(I know this is not how its done but this is the idea) return $colheights 
}else{
	(I know this is not how its done but this is the idea) return $colheights 
}

jQuery(‘#col_double, #col_single’).css(‘height’, $colheights);

I have tried many things but hitting dead ends. Maybe this is more complicated than I thought.
What am I missing here?

It is more complicated than you thought. It’s called newspaper columns, and is supported in CSS3.
The Future of “Newspaper” Column Style Layout with CSS 3

There are some scripted solutions too, that you can find by searching google, but they tend to get quite complex.