
/************************************************************************************************  
  Browserabfrage:
************************************************************************************************/
  function Browsercheck(){
	this.ver=navigator.appVersion 								 
	this.dom=document.getElementById?1:0						
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;   
	this.ie4=(document.all && !this.dom)?1:0;					
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;		
	this.ns4=(document.layers && !this.dom)?1:0;				
	this.ok=(this.ie5 || this.ie4 || this.ns4 || this.ns6)		
	if(this.ie6) this.ie5 = 1;
	return this
  }
  Browser = new Browsercheck();

/************************************************************************************************  
  MouseOver:
************************************************************************************************/

function preloadImages() {
	  if(document.images) {
		  document.imgpreload = new Array();
		  var array = preloadImages.arguments
		  for(i=0; i<array.length; i++) {
			  document.imgpreload[i] = new Image;
			  document.imgpreload[i].src = array[i];
		  }
	  }
  }
  
  function swapImage(doc, imgName, imgUrl, imgText) {
	  if(imgText!="") { window.status = imgText; }
  	if(doc.images) {
	    doc.images [imgName].srcORG = doc.images [imgName].src;
		  doc.images [imgName].src = imgUrl;
	  }
  }
  function swapImageRestore(doc, imgName) {
	  window.status = '';
	  if(doc.images) {
		  doc.images[imgName].src = doc.images[imgName].srcORG;
	  }
  }
  
  function swapImageRestoreInDiv(doc, nslayer, imgName) {
	  window.status = '';
      document[nslayer].document.images[imgName].src = document[nslayer].document.images[imgName].srcORG;
  }
  
  function swapSCRORG(doc, imgName, imgUrl) {
  	if(doc.images) {
	    doc.images [imgName].srcORG = imgUrl;
	  }
    swapImageRestore(doc,imgName);
  }
  
  function swapSCRORGInDiv(doc, nslayer, imgName, imgUrl) {
  	if(document.all || document.getElementById){
      if(doc.images) {
	    doc.images [imgName].srcORG = imgUrl;
	  }
      swapImageRestore(doc,imgName);
      
    }else if(document.layers){
      if(doc.images) {
        document[nslayer].document.images [imgName].srcORG = imgUrl;
	  }      
      swapImageRestoreInDiv(document,nslayer,imgName);
    }
  }
/************************************************************************************************  
  Bei Aenderung der Fenstergroesse:
************************************************************************************************/

function initWindow(){
//alert("bin in init");
  if(document.all);
  else if(document.layers)window.captureEvents(Event.RESIZE);
  else if(document.getElementById)window.addEventListener("resize", refr, false); 
  //window.onresize = refr;
  setTimeout("window.onresize = refr",500);
}
function refr() {
	 document.location.href = document.location.href;
}
/************************************************************************************************
  neues Fenster oeffnen:
************************************************************************************************/
function openWinCenter(url,name,breite,hoehe,x,y){
  var MyWindow =0;
  MyWindow = window.open(url,name,'toolbar=0,location=0,directories=0,statusbar=0,menubar=0,scrollbars=0,resizable=no,width='+breite+',height='+hoehe);
  if (MyWindow){
    MyWindow.moveTo(screen.width/2-(breite/2+x),screen.height/2-(hoehe/2+y));
    MyWindow.focus();
  }
}
function openWinCenterScroll(url,name,breite,hoehe,x,y){
  var MyWindow =0;
  MyWindow = window.open(url,name,'toolbar=0,location=0,directories=0,statusbar=0,menubar=0,scrollbars=yes,resizable=no,width='+breite+',height='+hoehe);
  if (MyWindow){
    MyWindow.moveTo(screen.width/2-(breite/2+x),screen.height/2-(hoehe/2+y));
    MyWindow.focus();
  }
}
/************************************************************************************************
  Layerinhat wechseln:
************************************************************************************************/
function writeDiv(DivID,text){  
  if(document.all){
    document.all[DivID].innerHTML = text;
  } else if(document.layers){
    document[DivID].document.open()
    document[DivID].document.write(text)
	document[DivID].document.close()
  } else if(document.getElementById){
    document.getElementById(DivID).innerHTML = text;
  }
}

function setContent(number){
  parent.frames.bild.document.images.Wechsel.src = Bilder[number];
  writeDivFS(number);
}
function writeDivFS(number){  
  if(document.all){
    parent.frames.bild.document.all['inhaltDiv'].innerHTML = inhalt[number];
  } else if(document.layers){
    parent.frames.bild.document['inhaltDiv'].document.open()
    parent.frames.bild.document['inhaltDiv'].document.write(inhalt[number])
	parent.frames.bild.document['inhaltDiv'].document.close()
  } else if(document.getElementById){
    parent.frames.bild.document.getElementById('inhaltDiv').innerHTML = inhalt[number];
  }
}