@charset "UTF-8";
/* CSS Document */

window.onload = function(){

     //高さ合わせるIDを指定

     var id = new Array("contentlw", "prod");

     var idHeight = new Array();

     var maxHeight = 0;//追記

     //指定IDの高さを取得

     for(i=0; i&lt;id.length; i++){

         idHeight[i] = document.getElementById(id[i]).offsetHeight;

     }

  

     //最大の高さをmaxHeightに格納

     for(i=0; i&lt;id.length-1; i++){

         /*ここ間違い

         maxHeight = Math.max(idHeight[i], idHeight[i+1]);

         */

         maxHeight = Math.max(maxHeight, idHeight[i]);

     }

  

     //一番高いのに合わせる

     for(i=0; i&lt;id.length; i++){

         document.getElementById(id[i]).style.height = maxHeight + &quot;px&quot;;

     }

 }