//---------------------BrowserDetection----------------------------------------
var ie4 = false;
var ns4 = false;
var ns6 = false;
var scrollableBrowser = false;
var navTyp = '';
var navVersion = 0;
var navOS = '';
var ua;

function detectBrowser(){//Ermittlung des Browser-Typs, Version und Plattform
ua=navigator.userAgent.toLowerCase();
var i = ua.indexOf('msie');
if (i >= 0){//wenn string 'msie' gefunden ist
	navTyp = 'MSIE';
    	navVersion = parseFloat(ua.substring(i+5, i+9));//msie version
  	if (navVersion >= 5){
		ie4 = true;
		scrollableBrowser = true;
	}
}
else{//browser ist kein msie
	i = ua.indexOf('mozilla/');
	if (i >= 0){//netscape oder kompatibel
		if (ua.indexOf('compatible') >= 0){//NS kompatible
			navTyp='';
			navVersion='';
		}
		else{//"echter" NS
			navTyp = 'NS';
			navVersion = parseFloat(ua.substring(i+8, i+12));		
			if(navVersion < 5 && navVersion >= 4){
				ns4 = true;
				scrollableBrowser = true;
			}
			else{
				if(navVersion >= 5){
					ns6 = true;
					scrollableBrowser = true;
				}
			}
		}
	}
}
//Ermittlung des Operation Systems
if ((ua.indexOf('win16')!=-1) || (ua.indexOf('windows3.1')!=-1) || (ua.indexOf('windows 3.1')!=-1) || (ua.indexOf('windows 16-bit')!=-1) || (ua.indexOf('16bit')!=-1)) {
	navOS='Win16';
	}
else if ((ua.indexOf('win95')!=-1) || (ua.indexOf('win32')!=-1) || (ua.indexOf('windows95')!=-1) || (ua.indexOf('windows 95')!=-1)) {
	navOS='Win95';
	}
else if ((ua.indexOf('winnt')!=-1) || (ua.indexOf('windowsnt')!=-1) || (ua.indexOf('windows nt')!=-1)) {
	navOS='WinNT';
	}
else if (ua.indexOf('mac')!=-1) {
	navOS='Mac';
	}
else if (ua.indexOf('x11')!=-1 || ua.indexOf('X11')!=-1) {
	navOS='Unix';
	}
else if (ua.indexOf('windows 2000')!=-1) {//opera meldet windows 2000
	navOS='Win2K';
	scrollableBrowser = false;
	}
else{
	navOS='';
	}
}

//---------------------Open-Window-Function-----------------------------------
var newWindow;
function openWindow (adress){	
	newWindow = open(adress,"myWindow","toolbar=no,location=no,menubar=yes,personalbar=no,status=no,scrollbars=yes,resizable=yes,left=0,top=0,screenX=0,screenY=0,width=550,height=300");
newWindow.focus();
}
//---------------------Open-Formular-Function-----------------------------------
function openForm (adress){	
	newWindow = open(adress,"myWindow","toolbar=no,location=no,menubar=no,personalbar=no,status=no,scrollbars=yes,resizable=yes,left=0,top=0,screenX=0,screenY=0,width=600,height=500");
}
//---------------------Print-Window-Function-----------------------------------
function printWindow(){
var macIE = 0;
if(ie4 && (navOS=='Mac')){
	macIE = 1;
	}
if(macIE != 1){
	window.print();
	}
}
//---------------------Close-Window-Function-----------------------------------
function closeWindow (){	
	window.close();
}
