// Browser sniffing

//Die auf diese Page (main.js) zugreifenden Pages enthalten teilweise Code von http://www.htmlguru.com"

function Is() {
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4b = (this.ns && (this.major == 4) && (this.minor <= 4.03));
    this.ns4 = (this.ns && (this.major >= 4) && (this.major < 5));
	this.ns6 = (this.ns && (this.major >= 5));
	this.ie   = (agent.indexOf("msie") != -1);
    this.ie3  = (this.ie && (this.major == 2));
    this.ie4  = (this.ie && (this.major >= 4));
    this.op3 = (agent.indexOf("opera") != -1);
    this.win   = (agent.indexOf("win")!=-1);
    this.mac   = (agent.indexOf("mac")!=-1);
    this.unix  = (agent.indexOf("x11")!=-1);	
}

var is = new Is();

// DOM

if(is.ns4) {
    doc = "document";
    sty = "";
    htm = ".document"
    img = ".document";
    xpos = "e.pageX";
    ypos = "e.pageY";
	
} else if(is.ie4) {
    doc = "document.all";
    sty = ".style";
    htm = "";
    img = ".document";
    xpos = "event.x";
    ypos = "event.y";
}



//OpenFenster
function OpenFenster(fname,url,breite,hoehe,xpos,ypos)  
{
	var aussehen="toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no";
	var browsername = navigator.appName;
	var auf=1;
	var  fbreite=eval(breite+0);
	var  fhoehe=eval(hoehe+0);
 
 if(is.ie)
 {//explorer
   myonb=window.open(url,fname,aussehen+',Width='+fbreite+',Height='+fhoehe+',left='+xpos+',top='+ypos);
 }
 else if(is.ns)
 {//netscape
   myonb=window.open(url,fname,aussehen+',Width='+fbreite+',Height='+fhoehe+',screenX='+xpos+',screenY='+ypos);
 }
 myonb.focus();
}


// -- autojump

  var downStrokeField;
  function autojump(fieldName,nextFieldName,fakeMaxLength,formname)
  {
//  var myForm=document.forms[document.forms.length - 1];
  var myForm=document.forms[formname];
  var myField=myForm.elements[fieldName];
  myField.nextField=myForm.elements[nextFieldName];

  if (myField.maxLength == null)
     myField.maxLength=fakeMaxLength;

  myField.onkeydown=autojump_keyDown;
  myField.onkeyup=autojump_keyUp;
  }

  function autojump_keyDown()
  {
  this.beforeLength=this.value.length;
  downStrokeField=this;
  }

  function autojump_keyUp()
  {
  if (
     (this == downStrokeField) && 
     (this.value.length > this.beforeLength) && 
     (this.value.length >= this.maxLength)
     )
     this.nextField.focus();
  downStrokeField=null;
  }
  
  
  
  function form_absenden(layername, formname)
  {
  	var form_objekt;
  	if(is.ns3 || is.ns4) {
		//Fuer Netscape bis Version 6 muss das Layer-Objekt beruecksichtigt werden
		eval("form_objekt=document."+layername+".document."+formname);
		form_objekt.submit();
	} else if(is.ie || is.ns6) {
		eval("form_objekt=document."+formname);
		form_objekt.submit();
	}
  }
  

  
