/*function fixH(one,two) {
if (document.getElementById(one)) {
var lh=document.getElementById(one).offsetHeight;
var rh=document.getElementById(two).offsetHeight;
var nh = Math.max(lh, rh); 
document.getElementById(one).style.height=nh+"px";
document.getElementById(two).style.height=nh+"px";
}
}*/

function fixH(one,two,lback,rback) {
if (document.getElementById(one)) {
  var lh=document.getElementById(one).offsetHeight;
  var rh=document.getElementById(two).offsetHeight;
  var lb=document.getElementById(lback).clientHeight;
  var rb=document.getElementById(rback).clientHeight;
  var nh = Math.max(lh, rh);
  var tlb=nh-90;
  document.getElementById(lback).style.height=tlb+"px";
  if (!(rh == lh)) {
    if (nh == rh) {
	  //lb+=(nh-lh);
	  lb=nh-90;
      document.getElementById(lback).style.height=lb+"px";
    }
    if (nh == lh) {
      rb+=(nh-rh);
      document.getElementById(rback).style.height=rb+"px";
    }
    document.getElementById(one).style.height=nh+"px";
    document.getElementById(two).style.height=nh+"px";
  }
}}

//this does it for three
function sortNum(a,b) { return b-a} 
function fixH2(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;
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";
}
}
}
//

//unhide navbar
function unhideNav(navmenu) {
if (document.getElementById(navmenu)) {
  document.getElementById(navmenu).style.visibility="visible";
  }
}

window.onload=function(){
unhideNav('navcontainer');
fixH('container_left','container_right','contentbackground','sidebackground3_pad');
//fixH2('left','right','centre');
}