﻿function sortNum(a,b) { return b-a} 

function Match2Columns(one,two) {
  if (document.getElementById(one)) {
    var obj=new Array(2);
    var option=[one,two];
    for(var i=0; i<option.length; i++) {
      document.getElementById(option[i]).style.height="auto";
      obj[i]=document.getElementById(option[i]).offsetHeight - 20;
      nh=obj.sort(sortNum);
    }
    nh1=nh.splice(1,2);
    for(var i=0; i<option.length; i++) {
      document.getElementById(option[i]).style.height=nh+"px";
    }
  }
}

function Match3Columns(one,two,three) {
  if (document.getElementById(one)) {
    var obj=new Array(3);
    var option=[one,two,three];
    for(var i=0; i<option.length; i++) {
      document.getElementById(option[i]).style.height="auto";
      obj[i]=document.getElementById(option[i]).offsetHeight - 20;
      nh=obj.sort(sortNum);
    }
    nh1=nh.splice(1,2);
    for(var i=0; i<option.length; i++) {
      document.getElementById(option[i]).style.height=nh+"px";
    }
  }
}

function show_image(filename, caption)
{
  document.getElementById('big_image').src = filename;
  document.getElementById('big_image').alt = caption;
  document.getElementById('caption').innerHTML = caption + '<br><br>';
}
