

window.onload = function () {

    if (jQuery('.videobox').length != 0)
        {
            var highest_column = 0;
            var totalcounter = 1;
            var counter = 1;
            
            jQuery('.videobox').each ( function () {
                
                if (jQuery(this).height() > highest_column)
                    highest_column = jQuery(this).height();
                
                counter++;
                totalcounter++;
                
                if (counter > 3)
                    {
                        set_height1 ('.videobox', highest_column, totalcounter, 3);
                        counter = 1;
                        highest_column = 0;
                    }
                            
            });
        }
        
    
    if (jQuery('.videobox2').length != 0)
        {
            var highest_column = 0;
            var totalcounter = 1;
            var counter = 1;
            
            jQuery('.videobox2').each ( function () {
                
                if (jQuery(this).height() > highest_column)
                    highest_column = jQuery(this).height();
                
                counter++;
                totalcounter++;
                
                if (counter > 2)
                    {
                        set_height1 ('.videobox2', highest_column, totalcounter, 2);
                        counter = 1;
                        highest_column = 0;
                    }
                            
            });
        }


}; 


function set_height1(element, new_height, pointer, elements_count)
    {
        counter = 1; 
        jQuery(element).each(function() {
                        
                        if (counter < pointer && counter >= (pointer - elements_count))
                                {
                                    jQuery(this).height(new_height);
                                }                                        
                        counter++;
                    });
    }

    
    
    