	var correction 	= ""
	
	function toggle()
	{
		eElement = document.getElementById('langChoice');
		if(eElement.className == "show"){
			eElement.className = "";	
		} else{
			eElement.className = "show";	
		}
	}
	
	window.onload = function() 
	{
		resizeContent();
	}
	
	
	
	window.onresize = function() 
	{
		resizeContent(); // in ie6 the onresize event fires more then once, wich crashes the browser
	}
	
	
	
	// browser-check
	var _agent=navigator.userAgent;

	function IsIE(){
		return _agent.indexOf("MSIE ")>-1;
	}
	
	function IEVersion(){
		var idx=_agent.indexOf("MSIE ");
		return parseFloat(_agent.substring(idx+5,_agent.indexOf(";",idx)));
	}
	
	function IsIE6Plus(){
		return IsIE()&&IEVersion()>=6;
	}
	
	function IsIE7(){
		return IsIE()&&IEVersion()>=7;
	}
	
	function IsFireFox(){
		return _agent.indexOf("Firefox")>-1;
	}
	

	
	function getWindowHeight() {
		var windowHeight = 0;
		if (typeof(window.innerHeight) == 'number') {
			windowHeight = window.innerHeight;
		}
		else {
			if (document.documentElement && document.documentElement.clientHeight) {
				windowHeight = document.documentElement.clientHeight;
			}
			else {
				if (document.body && document.body.clientHeight) {
					windowHeight = document.body.clientHeight;
				}
			}
		}
		
		return windowHeight;
	}
	
	function resizeContent(){

		var eStartTab = document.getElementById('gnStart');
		if(eStartTab = true){
			eStartTab.className = "active";
		}
   			
		if (document.getElementById) {
			
			var windowHeight = getWindowHeight();
			if (windowHeight > 0) {
				
				// retrieve all heights
				var colsElement 	= document.getElementById('cols');
				if (colsElement == null) return;
				var colsHeight 		= colsElement.offsetHeight;
				
				var contentElement 	= document.getElementById('content');
				if (contentElement == null) return;
				var contentHeight 	= contentElement.offsetHeight;

				var headerElement 	= document.getElementById('header');
				if (headerElement == null) return;
				var headerHeight 	= headerElement.offsetHeight;

				var footerElement 	= document.getElementById('footer');
				if (footerElement == null) return;
				var footerHeight 	= footerElement.offsetHeight;
				
				var wrapperElement 	= document.getElementById('wrapper');
				if (wrapperElement == null) return;
				var wrapperHeight 	= wrapperElement.offsetHeight;
				
				
				
				var contentCorrection 	= 40
				var colsCorrection 		= 40
				
				if (IEVersion()>6){
					//contentCorrection = 50
					//colsCorrection = 50
				}
				if (IEVersion()<7){
					contentCorrection 	= 0
					colsCorrection 		= 0
				}
				
				

				// calculate and set new height
				var newContentHeight 			= windowHeight - (headerHeight + footerHeight + contentCorrection);
				contentElement.style.height 	= newContentHeight + 'px';
				contentElement.style.minHeight 	= newContentHeight + 'px';

				var newColsHeight 				= windowHeight - (headerHeight + footerHeight + colsCorrection);
				colsElement.style.height 		= newColsHeight + 'px';
				colsElement.style.minHeight 	= newColsHeight + 'px';
				
				
				
				
				if (document.body.offsetHeight>windowHeight){
					correction = (document.body.offsetHeight-windowHeight)
					
					var contentCorrection 			= (newContentHeight-correction)
					var colsCorrection 				= (newColsHeight-correction)
					
					contentElement.style.height 	= contentCorrection + 'px';
					contentElement.style.minHeight 	= contentCorrection + 'px';

					colsElement.style.height 		= colsCorrection + 'px';
					colsElement.style.minHeight 	= colsCorrection + 'px';
				}
				
				wrapperElement.style.height 	= windowHeight + 'px';
				//document.getElementById('footer').style.backgroundColor = "red"
				
			}
			
		}
	
	}
	


	
	function activateTab(sActiveTab)
	{
		
		var eTab = document.getElementById(sActiveTab);
		var eNav = document.getElementById('globalNav');
		
		// reset all active elemets
		var aTabs = eNav.getElementsByTagName("li")
		for(i = 0; i < aTabs.length; i++)
		{
			if(aTabs[i].className == "active")
			{				
				aTabs[i].className  = "";
			}
		}
		
		eTab.className = "active";
	}

	
	function resetTab(sActiveTab)
	{
		//version of code july 2008
 		var eNav = document.getElementById('globalNav');

        // reset all active elemets
        var aTabs = eNav.getElementsByTagName("li")
        for(i = 0; i < aTabs.length; i++)
        {
              if(aTabs[i].className == "active")
              {                                    
                   aTabs[i].className  = "";
              }
        }

        //This is for the first row in the menu.
        if(document.getElementById('gnStart'))
        {
		    var eStartTab = document.getElementById('gnStart');
		    eStartTab.className = "active";
        }
        //This is for the second row in the menu.
        if(document.getElementById('gnSubStart'))
        {
		    var eStartTab = document.getElementById('gnSubStart');
		    eStartTab.className = "active";
		}
	}
