// JavaScript
//get Window Height
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;
}

//Set Footer
function setBG(){
  var box=document.getElementById('box');
	var boxHeight=document.getElementById('box').offsetHeight;
	var windowHeight = getWindowHeight();
	var shadow = document.getElementById('shadow');

	if(windowHeight > boxHeight){	
		box.style.height=(windowHeight-22) + 'px';
	}
	
}

// Only IE
function setBGIE(){
	var box=document.getElementById('box');
	var footer =document.getElementById('footer');
	var shadow = document.getElementById('shadow');
	var boxBorder = document.getElementById('boxBorder');
	var kreise2 = document.getElementById('kreise2');
	var boxHeight=box.offsetHeight;
	var windowHeight = getWindowHeight();
		
	var myWidth = box.offsetLeft;
  footer.style.top=(windowHeight-38) + 'px';
	
	box.style.left=8 + 'px';
		
	var headerLeft = document.getElementById('header').offsetLeft;
	shadow.style.left=(headerLeft+960) + 'px';
	shadow.style.height=(windowHeight-17) + 'px';
	boxBorder.style.left=(headerLeft-1) + 'px';
	boxBorder.style.height=(windowHeight-18) + 'px';
	kreise2.style.left=(headerLeft+483) + 'px';
	
	document.getElementById('body').style.backgroundPosition=(headerLeft)+'px';
	
	if(windowHeight > boxHeight){	
		box.style.height=(windowHeight-20) + 'px';
	}
	
	if(document.getElementById('banner')){
		document.getElementById('banner').style.top=(windowHeight-75) + 'px';
	}
	
}

// Show / Hide
function showHideLang(id){
	if(document.getElementById("langshow"+id).style.display == 'none'){
		document.getElementById("lang"+id).className = 'lang2';
		document.getElementById("langshow"+id).style.display = 'block';
		
	}else{
		document.getElementById("lang"+id).className = 'lang';
		document.getElementById("langshow"+id).style.display = 'none';
	}
}

function showHide(id){
	if(document.getElementById("link"+id).style.display == 'block'){
		document.getElementById("box"+id).style.display = 'block';
		document.getElementById("link"+id).style.display = 'none';
		setBG();
		
	}else{
		document.getElementById("box"+id).style.display = 'none';
		document.getElementById("link"+id).style.display = 'block';
		setBG();
	}
}

function showHideDat(id){
	if(document.getElementById("box"+id).style.display == 'none'){
		document.getElementById("box"+id).style.display = 'block';
	}else{
		document.getElementById("box"+id).style.display = 'none';
	}
}

// dropdown ID 
function change_id(in1,in2){
	var str1='document.'+in1+'.'+in2+'.selectedIndex'
	var str2='document.'+in1+'.'+in2+'['+str1+'].value'
	var id=eval(str2);
	var laststr="<cfoutput>#ListLast(cgi.path_info, '/')#</cfoutput>";
	var url=self.location;
	var newurl=url.replace(id, laststr);
}


//Popup

function openWin (URL,Wid,Hei) {
	aWindow = window.open(URL,"OpenWin",
        'toolbar=no,status=no,scrollbars=yes,resizable=yes,menubar=no,width=' + openWin.arguments[1] +
        ',height=' + openWin.arguments[2]);
}


function openWinToolbar (URL,Wid,Hei) {
     aWindow = window.open(URL,"_blank",
        'toolbar=yes,status=no,scrollbars=yes,resizable=yes,menubar=no,width=' + openWinToolbar.arguments[1] +
        ',height=' + openWinToolbar.arguments[2]);
}


