var px = 50 ;
var timer ;
var istYscroll = 0,
    istXscroll = 0,
    maxXscroll = 400 ;
    maxYscroll = 165 ;

function scrollDenDiv (val){ 
 clearTimeout (timer) ; 
 d = document.getElementById('schrank') ;
 i = document.getElementById('schrank_innen') ;
 y = d.scrollTop ;
 x = d.scrollLeft ;
 if ((val == 1) || (val == 2)){
  if (val == 1){
   y-=px ;
   istYscroll+=px ;
  }
  if (val == 2){
   y+=px ;
   istYscroll+=px ;
  }
  if (y <= d.scrollHeight-d.offsetHeight + px && y >= 0 - px){ 
   d.scrollTop = y ;
   timer = setTimeout ('scrollDenDiv ('+val+')', 50) ; 
  }
  if ((y < 0) || (y > d.scrollHeight - d.offsetHeight) || (istYscroll >= maxYscroll)){
   istYscroll = 0 ;
   clearTimeout (timer) ;
//   alert ('ScrollHeight = '+d.scrollHeight+   '\r\noffsetHeight = '+d.offsetHeight+          '\r\nScrollTop = '+d.scrollTop+          '\r\ny = '+y) ;
  } 
 }
 if ((val == 3) || (val == 4)){




  if (val == 3){
   x-=px ;
   istXscroll+=px ;
  }
  if (val == 4){
   x+=px ;
   istXscroll+=px ;
  }
  if ((x <= d.scrollWidth-d.offsetWidth + px) && (x >= 0 - px)){ 
   d.scrollLeft = x ;
   timer = setTimeout ('scrollDenDiv ('+val+')', 50) ;
  }
  if ((x < 0) || (x > (d.scrollWidth - d.offsetWidth)) || (istXscroll >= maxXscroll)) {
   istXscroll = 0 ;
   clearTimeout (timer) ;
//   alert ('scrollWidth = '+d.scrollWidth+          '\r\noffsetWidth = '+d.offsetWidth+          '\r\nScrollLeft = '+d.scrollLeft+          '\r\nx = '+x) ;
  }


 }
} 

function objekt_bild (rahmen, FotoPath){
	var Foto ;
	Foto = new Image () ;
	Foto.src = FotoPath ;
	window.document.getElementById (rahmen).src = Foto.src ;
}

function chkFormular () {
        if (document.box100.vorname.value == "") {
         alert ("Bitte Ihren Vornamen eingeben!") ;
         document.box100.vorname.focus () ;
         return false ;
        }
        else if (document.box100.name.value == "") {
         alert ("Bitte Ihren Namen eingeben!") ;
         document.box100.name.focus () ;
         return false ;
        }
        else if (document.box100.strasse.value == "") {
         alert ("Bitte Strasse eingeben!") ;
         document.box100.strasse.focus () ;
         return false ;
        }
        else if (document.box100.plz.value == "") {
         alert ("Bitte Postleitzahl (PLZ) eingeben!") ;
         document.box100.plz.focus () ;
         return false ;
        }
        else if (document.box100.ort.value == "") {
         alert ("Bitte Ort eingeben!") ;
         document.box100.ort.focus () ;
         return false ;
        }
        else if (document.box100.land.value == "") {
         alert ("Bitte Land eingeben!") ;
         document.box100.land.focus () ;
         return false ;
        }
        else if (document.box100.email.value == "") {
         alert ("Bitte Ihre eMailadresse eingeben!") ;
         document.box100.email.focus () ;
         return false ;
        }
        else if (!box100.email.value.match (/^([a-zA-Z0-9_])+([a-zA-Z0-9_\.\-])*@([a-zA-Z0-9])+([a-zA-Z0-9_\.\-])+\.([a-zA-Z0-9]){2,6}$/)) {
         alert ("Falsche eMailadresse!") ;
         document.box100.email.focus () ;
         return false ;
        }
        else if (document.box100.passwort.value == "") {
         alert ("Bitte Passwort eingeben!") ;
         document.box100.passwort.focus () ;
         return false ;
        }
        else if(!box100.passwort.value.match (/^([0-9a-zA-ZüÜäÄöÖ])+([0-9a-zA-ZüÜäÄöÖ\-\.\s])*$/)){
         alert ("Bitte nur Buchstaben und Zahlen im Feld Passwort eingeben!") ;
         document.box100.passwort.focus () ;
         return false ;
        }
        else if (document.box100.passwort2.value == "") {
         alert ("Bitte Passwort wiederholen!") ;
         document.box100.passwort2.focus () ;
         return false ;
        }
        else if(!box100.passwort2.value.match (/^([0-9a-zA-ZüÜäÄöÖ])+([0-9a-zA-ZüÜäÄöÖ\-\.\s])*$/)){
         alert ("Bitte nur Buchstaben und Zahlen im Feld Passwort wiederholen eingeben!") ;
         document.box100.passwort2.focus () ;
         return false ;
        }
        else if (document.box100.passwort.value != document.box100.passwort2.value) {
         alert ("Passworter ungleich!") ;
         document.box100.passwort.focus () ;
         return false ;
        }
}

function ansuchen (sprache){
   la = 'suchen.php?spr='+sprache+'&such_kriterien='+window.document.box220.such_kriterien.value ;
   window.open (la, target='_top') ;  
}
