 
// Prueft, welcher Browser verwendet wird
function checkBrowser(){
  this.name = navigator.userAgent;
  this.ver=navigator.appVersion
  this.dom=document.getElementById?1:0
  this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
  this.ie4=(document.all && !this.dom)?1:0;
  this.opera = (this.name.indexOf("Opera")>-1)?1:0;
  this.ns5=( (this.dom && parseInt(this.ver) >= 5) || this.opera ) ?1:0;
  this.ns4=(document.layers && !this.dom)?1:0;
  this.ie4mac=this.ie4 && navigator.userAgent.indexOf("Mac")>-1
  this.ns4mac=this.ns4 && navigator.appVersion.indexOf("Mac")>-1
  this.ie5mac=this.ie5 && navigator.userAgent.indexOf("Mac")>-1
  this.ie55=(this.ver.indexOf("MSIE 5.5")>-1 && this.dom)?1:0;
  this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
  this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom)?1:0;
  this.ie8=(this.ver.indexOf("MSIE 8")>-1 && this.dom)?1:0;
  this.mac = ( this.ie4mac || this.ns4mac || this.ie5mac ) 
  this.ns = ( this.ns4 || this.ns5 );
  this.ie = ( this.ie6 || this.ie5 || this.ie4 );
  this.ie5 = (this.ie7 || this.ie6 || this.ie5 ); 
  this.bw=( this.dom || this.ie8 || this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ie5mac)
  return this;
}
bw = new checkBrowser();

function switchDisplay(sID) {
	var obj = document.getElementById(sID);
	obj.style.display = obj.style.display == 'none' ? '' : 'none';
}

// oeffnet ein neues Fenster in der �bergebenen Groesse
function openWin(strFile,intWidth,intHeight){

	if( !intWidth ) intWidth = 400;
	if( !intHeight ) intHeight = 400;
	
	var now=new Date()
	winname="a" + now.getTime()
	
	var X = (screen.width/2)-intWidth/2;
	var Y = (screen.height/2)-intHeight/2;
	
	params = "top="+Y+", left="+X+", width="+intWidth+",height="+intHeight+",resizable=0,status=no,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0 ";
	newwin = window.open( 'wwwNeu/'+strFile, winname , params);
	
	if( window.focus ) newwin.focus();
	
}

// Zentriert das geoeffnete Fenster in der Mitte des Bildschirms
function centerWin() {
	var X = (screen.width/2)-getWinWidth()/2;
	var Y = (screen.height/2)-getWinHeight()/2;
	window.moveTo(X, Y);
	
}

// Ermittelt die Breite des Fensters
function getWinWidth() {
	if (window.outerWidth) return window.outerWidth;
	else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
	else return 0;
}

// Ermittelt die Hoehe des Fensters
function getWinHeight() {
	if (window.outerHeight) return window.outerHeight;
	else if (document.body && document.body.offsetHeight) return document.body.offsetHeight+60;
	else return 0;
}


function fieldContentFocus(obj, className) {
	
	if(bw.dom) {
		obj.className = className;
	}
	
}

function fieldContentBlur(obj, className) {
	
	if(bw.dom) {
		obj.className = className;
	}
	
}

function showLogin() {
	document.getElementById('loginDiv').style.visibility = 'visible';
	document.getElementById('loginDivFieldName').focus();
}

