// JavaScript Document

isIE = false;

if(document.all && !window.opera){

	isIE = true;
	

}else{
	window.onresize = initial;
}



function initial(){
	
	var wH = windowHeight();
	var wrapper = document.getElementById("wrapper");
	
	if(!document.getElementById("wrapper")){
		
	}else{

		if(wH > 0){

			wrapper.style.height = (wH - 22) + "px";
			
			innerContent = (document.getElementById("inner_content")) ? document.getElementById("inner_content") : document.getElementById("intro_content");
			
			flashIntro = document.getElementById("flash_intro");
			
			offset = (flashIntro) ? 18: 40;
			
			//innerContent.style.height = (parseInt(wrapper.style.height) - (parseInt(innerContent.offsetTop) + offset)) + "px";
			//alert(parseInt(innerContent.offsetTop) + offset)
			lefter = document.getElementById("left");
			
			lefter.style.height = parseInt(wrapper.style.height) - (lefter.offsetTop+20) + "px";
			lefter.style.minHeight =  lefter.style.height;
			innerContent.style.minHeight = innerContent.style.height = (parseInt(wrapper.style.height) - (parseInt(innerContent.offsetTop) + offset)) + "px";
			

			if(flashIntro) {
			
				if(parseInt(innerContent.style.minHeight) > parseInt(flashIntro.height)){
					flashIntro.style.position = "absolute";
					
					flashIntro.style.top = parseInt(innerContent.style.minHeight) - parseInt(flashIntro.height) + 21 + "px";
				}
			}
			
			if(navigator.userAgent.indexOf("Safari") > 0){
				innerContent.style.top = innerContent.offsetTop - 1 + "px";
				innerContent.style.height = (parseInt(innerContent.style.height)) + 1 + "px";
			}
			
		}
		
	}
	
	if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
 		var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 		 if (ffversion==2){
 
			if(document.getElementById("inner_content")){
				document.getElementById("inner_content").style.width = "70.1em";
			}
			
			if(document.getElementById("intro_content")){
				document.getElementById("intro_content").style.width = "75.0em";
			}	
			
			if(document.getElementById("top_menue")){
				document.getElementById("top_menue").style.width = "75.1em";
			}				
			
		}
	
	}
	if(isIE){
		setTimeout("setWindowReload()", 1000);	
	}

	wrapper.style.visibility = "visible";	

}

function windowWidth(){

	if (self.innerHeight){// all except Explorer
		
		wW = self.innerWidth;
				
	}
	else if (document.documentElement && document.documentElement.clientHeight){// Explorer 6 Strict Mode
		
		wW = document.documentElement.clientWidth;
		
	}
	else if (document.body){// other Explorers
		
		wW = document.body.clientWidth;
		
	}
	
	return wW;
	
}	

function windowHeight(){

	if (self.innerHeight){// all except Explorer
		
		wH = self.innerHeight;
				
	}
	else if (document.documentElement && document.documentElement.clientHeight){// Explorer 6 Strict Mode
		
		wH = document.documentElement.clientHeight;
		
	}
	else if (document.body){// other Explorers
		
		wH = document.body.clientHeight;
		
	}
	
	return wH;
	
}	

function setWindowReload(){
	window.onresize = initial;//Function("document.location.reload()");	
}


	




