//Derived from a script by Alejandro Gervasio. 
//Modified to work in FireFox by Stefan Mischook for Killersites.com
//How it works: just apply the CSS class of 'column' to your pages' main columns.

function matchColumns(classname){
     var divs,contDivs,maxHeight,divHeight,d; 
     divs=document.getElementsByTagName('div');  // get all <div> elements in the document 
     contDivs=[]; 
     maxHeight=0;  // initialize maximum height value 
     for(var i=0;i<divs.length;i++){  // iterate over all <div> elements in the document 
          if(new RegExp("\\b" + classname + "\\b").test(divs[i].className)){   // make collection with <div> elements with class attribute 'container' 
                d=divs[i]; 
                contDivs[contDivs.length]=d; 
                if(d.offsetHeight){   // determine height for <div> element 
                     divHeight=d.offsetHeight; 					
                } 
                else if(d.style.pixelHeight){ 
                     divHeight=d.style.pixelHeight;					 
                } 
                maxHeight=Math.max(maxHeight,divHeight);  // calculate maximum height 
          } 
     } 
     for(var i=0;i<contDivs.length;i++){    // assign maximum height value to all of container <div> elements 
          contDivs[i].style.height=maxHeight + "px"; 
     } 


} //close function
