// JavaScript Document
function setSelected (button) {
	alert(button.firstChild.className);
	button.firstChild.className="active";	
}

function matchColumns()
{
	var height1=getHeight('wrapper');
	if (height1>450) {
		document.getElementById('subMenu').style.height=height1-getHeight('header')+"px";	
		document.getElementById('cntColRight').style.height=height1-getHeight('header')-getHeight('mainnav')+"px";	
		document.getElementById('cntColLeft').style.height=height1-getHeight('header')-getHeight('mainnav')+"px";	
		document.getElementById('leftline').style.height=height1-getHeight('header')+"px";	
	}	
	if (document.getElementById('subMenu').style.height=="0px") {
		var height2=document.getElementsByTagName('body')[0].offsetHeight;	
		document.getElementById('subMenu').style.height=height2+"px";	
		document.getElementById('cntColRight').style.height=height2+"px";	
		document.getElementById('cntColLeft').style.height=height2+"px";	
		document.getElementById('leftline').style.height=height2+"px";	
	} else {
		//alert(document.getElementById('subMenu').style.height);	
	}
}

function getHeight(element)
{
	var height=document.getElementById(element).style.height;
	if (height<=0) {
		height=document.getElementById(element).offsetHeight;	
	}
	return height;
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
