// JavaScript Document
// Footer auto fixed

var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring,tdHeight;

var thisBrowser = browserDetect();
var headerHeight = 152;
var footerHeight = 22;


function browserDetect(){

	if (checkIt('konqueror'))
	{
		browser = "Konqueror";
		OS = "Linux";
	}
	else if (checkIt('safari')) browser = "Safari"
	else if (checkIt('omniweb')) browser = "OmniWeb"
	else if (checkIt('opera')) browser = "Opera"
	else if (checkIt('webtv')) browser = "WebTV";
	else if (checkIt('icab')) browser = "iCab"
	else if (checkIt('msie')) browser = "Internet Explorer"
	else if (checkIt('mozilla')) browser = "Mozilla"
	else if (!checkIt('compatible'))
	{
		browser = "Netscape Navigator"
		version = detect.charAt(8);
	}
	else browser = "An unknown browser";

	if (!version) version = detect.charAt(place + thestring.length);

	if (!OS)
	{
		if (checkIt('linux')) OS = "Linux";
		else if (checkIt('x11')) OS = "Unix";
		else if (checkIt('mac')) OS = "Mac"
		else if (checkIt('win')) OS = "Windows"
		else OS = "an unknown operating system";
	}

    return browser;

	function checkIt(string)
	{
		place = detect.indexOf(string) + 1;
		thestring = string;
		return place;
	}
}

function browserSize() {
  var tmpHeight = new Object();
  if( typeof( window.innerWidth ) == 'number' ) {
    //geen IE
    tmpHeight.myHeight = window.innerHeight;
  } else if( document.documentElement && document.documentElement.clientHeight) {
    //IE 6+   
    tmpHeight.myHeight = document.documentElement.clientHeight;
	
  } else if( document.body && document.body.clientHeight) {
    //IE 4
    tmpHeight.myHeight = document.body.clientHeight;

  }
  return tmpHeight;
}

function setTDHeight() {
    tmpObj = browserSize();
    tdHeight = tmpObj.myHeight - (footerHeight + headerHeight);
    if (tmpObj.myHeight > screen.height) return false; // for MSIE
    if (tmpObj.myHeight > (footerHeight + headerHeight)) {
		if (thisBrowser == "Internet Explorer"){
			//document.getElementById("td_content").style.height = tdHeight;
			document.getElementById("table_content").style.height = tdHeight;
			//document.getElementById("div_content").style.height = tdHeight;
		}
		if (thisBrowser == "Mozilla"){
			document.getElementById("td_content").height = tdHeight - 15;
			document.getElementById("table_content").height = tdHeight;
			//alert(tmpObj.myHeight);
			//document.getElementById("div_content").height = tdHeight;
		}
	}
}