function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
function toggle( targetId ){
  if (document.getElementById){
    target = document.getElementById( targetId );
    if (target.style.display == "none"){
      target.style.display = "";
    } 
    else {
      target.style.display = "none";
    }
  }
}

function lkbacheck(nr){
  if (nr==1 && document.lAuswahl.Zwei.value.length==4) {
	document.lAuswahl.SKtypNr.value=0;
	document.lAuswahl.Drei.focus();
	document.lAuswahl.Drei.select();
  }	
  if (nr==2 && document.lAuswahl.Drei.value.length==3){ 
  	document.lAuswahl.SKtypNr.value=1;
	document.lAuswahl.submit();
  }
  else document.lAuswahl.SKtypNr.value=0;	
}
function skbacheck(nr){
  if (nr==1 && document.Auswahl.Zwei.value.length==4) {
	document.Auswahl.SKtypNr.value=0;
	document.Auswahl.Drei.focus();
	document.Auswahl.Drei.select();
  }	
  if (nr==2 && document.Auswahl.Drei.value.length==3){ 
	document.Auswahl.SKtypNr.value=1;
	document.Auswahl.submit();
  }
  else document.Auswahl.SKtypNr.value=0;	
}

var richtung = 1;
var pause = 3000;
var warte = 30;
var fraemes = 100;
var time = warte;
var aktiv;
var wert1 = 1/fraemes;
var wert2 = 1-wert1;
var name = navigator.appName;
function ueberblend()
{
  e = document.getElementById ('bild1');
  
  if (!e.filters) // Netscape, Opera, Safari
  {
	// Firefox
	document.getElementById('bild1').style.MozOpacity = wert2;
  	document.getElementById('bild2').style.MozOpacity = wert1;
	// Opera
	document.getElementById('bild1').style.opacity = wert2;
  	document.getElementById('bild2').style.opacity = wert1;
  }	
  else  // IE 
  {	
	document.getElementById('bild1').style.filter="alpha(opacity="+ Math.round(wert2*100) +")";
  	document.getElementById('bild2').style.filter="alpha(opacity="+ Math.round(wert1*100) +")";
  }	
  if(wert1 <= (1/fraemes) || wert1 > (1-1/fraemes))
  { 
	window.clearTimeout(aktiv);
	if(wert1 <= 0.1) 
	{	
		richtung = 1;
	}
	else
	{
		richtung = 0;
	}
	time= pause;
  }
  else 
  {
	time = warte;
  }		
  if(richtung==1) // plus
    {
	wert1 =  wert1 + ( 1/fraemes) ;
	wert2 = 1 - wert1;
    }
    else
    {
	wert1 =  wert1 - ( 1/fraemes);
	wert2 = 1 - wert1;
    }		
    aktiv= setTimeout("ueberblend()",time);
}
var z=0; var win=""; var hoehe="250";
function bild(id,breite,hoehe,Anb) {
	winold=win; win="win"+z
	if(winold != ""){win="";  w.close()}
	w= window.open ("bild.php?{SID}&id=" + id +"&Anb=" + Anb, win,"width=" + (breite + 20) +",height=" + (hoehe + 20));
	z=z+1
}
function bilds(id,breite,hoehe,Anb) {
	winold=win; win="win"+z
	if(winold != ""){win="";  w.close()}
	w= window.open ("bilds.php?{SID}&id=" + id +"&Anb=" + Anb, win,"width=" + (breite + 20) +",height=" + (hoehe + 20));
	z=z+1
}

function skbacheck(nr){
  if (nr==1 && document.Auswahl.Zwei.value.length==4) {
	document.Auswahl.SKtypNr.value=0;
	document.Auswahl.Drei.focus();
	document.Auswahl.Drei.select();
  }	
  if (nr==2 && document.Auswahl.Drei.value.length==3){ 
  	document.Auswahl.SKtypNr.value=1;
	document.Auswahl.submit();
  }
  else document.Auswahl.SKtypNr.value=0;	
}
