var availableHeight = 0;
var availableWidth = 0;
var contentMinHeight = 467;
var headerHeight = 61;
var footerHeight = 33;

function findSizes() {
  if( typeof( window.innerHeight ) == 'number' ) {
    //Non-IE
    availableWidth = window.innerWidth;
    availableHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    availableWidth = document.documentElement.clientWidth;
    availableHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientHeight ) ) {
    //IE 4 compatible
    availableWidth = document.body.clientWidth;
    availableHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
}

function size2fit(div2use) {
	var contentDiv = document.getElementById(div2use);
	var contentHeight = contentDiv.style.height;
		contentHeight = parseInt(contentHeight.substring(0,contentHeight.length - 2));
	
	//alert('Available height reported as ' + availableHeight);
	//alert('Content current height reported as ' + contentHeight);
	
	if (availableHeight > contentMinHeight) {
	//	alert("I see available height is greater than content height");
		contentDiv.style.height = (availableHeight - footerHeight - headerHeight) + "px";
	}
}

function hideDiv(div2use) {
	//alert('attempt to hide ' + div2use);
	var div2hide = document.getElementById(div2use);
	div2hide.style.display = "none";
	div2hide.style.visibility = "hidden";
}

function showDiv(div2use) {
	//alert('attempt to show ' + div2use);
	var div2show = document.getElementById(div2use);
	div2show.style.display = "block";
	div2show.style.visibility = "visible";
}