﻿/**
 *  Function that sets the height of the artists box
 */
function setHeight() {
    
    var x=document.getElementsByTagName("div");
    var len = x.length;
    
    // Get all heights
    var count=0;
    var col = new Array();
    
        /*[0 3 6]
          [1 4 7]
          [2 5 8]*/
    
    for(i=0;i<len;i++){
        if(x[i].className == 'bands') {
            //x[i].style.display = 'none';
            col[count] = x[i].offsetHeight;
            count++;
        }
    }
    
    // Get max height for each row
    var height_firstRow = Math.max(Math.max(col[0], col[3]), col[6]);
    //alert(col[0] + " | " + col[3] + " | " + col[6] + " | Max: " + height_firstRow);
    var height_secondRow = Math.max(Math.max(col[1], col[4]), col[7]);
    //alert(col[1] + " | " + col[4] + " | " + col[7] + " | Max: " + height_secondRow);
    var height_thirdRow = Math.max(Math.max(col[2], col[5]), col[8]);
    //alert(col[2] + " | " + col[5] + " | " + col[8] + " | Max: " + height_thirdRow);
    
    // Set max height to each div
    count=0;
    for(i=0;i<len;i++){
        if(x[i].className == 'bands') {
            switch(count){
                case 0: x[i].style.height=height_firstRow+'px'; break;
                case 1: x[i].style.height=height_secondRow+'px'; break;
                case 2: x[i].style.height=height_thirdRow+'px'; break;
                case 3: x[i].style.height=height_firstRow+'px'; break;
                case 4: x[i].style.height=height_secondRow+'px'; break;
                case 5: x[i].style.height=height_thirdRow+'px'; break;
                case 6: x[i].style.height=height_firstRow+'px'; break;
                case 7: x[i].style.height=height_secondRow+'px'; break;
                case 8: x[i].style.height=height_thirdRow+'px'; break;
            }
            count++;
        }
    }
    
}

window.onload=setHeight;



