
var bild1 = ''; // Bilder auf den Seiten
var bild2 = ''; // Bilder auf den Seiten

   //var w_LM = 760; // width_LayerMiddle für Positionierung Hintergrundbild
   var w_LM = 780; // width_LayerMiddle für Positionierung Hintergrundbild
   var w_LL = 0;   // width_LayerLeft
   var w_LR = 0;   // width_LayerRight
   var p_LR = 0;   // pos_LayerRight
   var LOvrlp = 50; // Overlap zum Verstecken des Scrolltextes bei Webdes, wird in 
                   //  SetFensterName gefüllt.
   var ProgDif = 10;// Leichte Verschiebung nach links aus optischen Gründen bei Programmierung,
                   //  wird in SetFensterName gefüllt.

   var Show = "visible";
   var Hide = "hidden";
   var menuon = false; //für Menus

var FString = ' '; // check Formulare
var FMail;         // Window für Mail


var merkQW = 0;
var merkQH = 0;
var merkHW = 0;
var merkHH = 0;

var FQ;
var FH;

var FGoogle;

var alt_y = 0;
var BrowserName    = ' ';
var BrowserVersion = ' ';
var MSIE = false;
var voidImg    = 5;
var voidFImg   = 8;

// #######################################################
Fotos = new Array(30); // Funktion SetFotoGross
for (var i = 1; i < 100; i++)
{
   Fotos[i] = new Array(2);
}

   var Show = "visible";
   var Hide = "hidden";

// #######################################################

var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0;
DHTML_init();

/*************************************************************************/
function DHTML_init() {

 //alert("DHTML_init");
 
 if (window.opera) {
     OP = 1;
 }
 if(document.getElementById) {
   DHTML = 1;
   DOM = 1;
 }
 if(document.all && !OP) {
   DHTML = 1;
   MS = 1;
 }
if(document.layers && !OP) {
   DHTML = 1;
   NS = 1;
 }

//alert("OP= "+ OP + " DHTML= " + DHTML + " DOM= " + DOM + " MS= " + MS);
}

// *****************************************************************************************
function GoogleTranslate(Lang)
{
	switch(Lang) 
	{
		case "deutsch":
			Parm = "translate_t#en|de|";
		break;

		case "english":
			Parm = "translate_t#es|en|";
		break;

		case "espanol":
			Parm = "translate_t#en|es|";
		break;

		case "francais":
			Parm = "translate_t#de|fr|";
		break;
		
		default:
			Parm = "";
		break;
	}
	
	Google = "http://translate.google.com/"+Parm;

	if (!FGoogle || FGoogle.closed == true)
	{
	}
	else
	{
		FGoogle.close();
	}

	FGoogle = window.open(Google,"GoogleFenster","resizable=yes,scrollbars=yes,width=750,height=500,screenX=20,screenY=20" );

	if (!FGoogle)
	{
			//alert("Pop up windows are suppressed on your computer!");
		return;
	}

	FGoogle.focus();

}


/*************************************************************************/
function eingabeUeberpruefen(formular) {
  for (var i=0; i<formular.elements.length; ++i) {
    if (((formular.elements[i].value == "Stichworte eingeben") || (formular.elements[i].value == "")) && (formular.elements[i].name == "sp-q")) {
      alert("Sie haben keine Stichworte eingegeben!\n\nBitte geben Sie mindestes ein Stichwort ein und dann erst \"Stichworte suchen\" auswaehlen.");
      formular.elements[i].focus();
      return false;
    }
  }
  return true;
}

/*************************************************************************/
function Fensterweite()
{
 if (window.innerWidth) return window.innerWidth;
 else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
 else return 0;
}

/*************************************************************************/
function Fensterhoehe()
{
 if (window.innerHeight) return window.innerWidth;
 else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
 else return 0;
}

/*************************************************************************/
function BrowserAbfrage()
{
    
   BrowserTyp = navigator.userAgent;
   BrowserVersion = navigator.appVersion;
   
   //alert("BrowserVersion= " + BrowserVersion);
   //alert("BrowserTyp= " + BrowserTyp);
   
   if(BrowserTyp.search('MSIE') > -1)
   {
      //alert("Internet Explorer!");
      BrowserName = 'Internet Explorer';
      Pfeil_Headline = 1;
      MSIE = true;
   }
   else
      if(BrowserTyp.search('Opera') > -1)
      {
         //alert("Opera!");
         BrowserName = 'Opera';
         Pfeil_Headline = 1;
      }
      else
         if(BrowserTyp.search('Lynx') > -1)
         {
            //alert("Lynx!");
            BrowserName = 'Lynx';
            Pfeil_Headline = 0;
         }
         else
            if(BrowserTyp.search('Gecko') > -1)
            {
               //alert("Mozilla!");
               BrowserName = 'Mozilla';
               Pfeil_Headline = 1;
            }
            else
               {
                  if (BrowserTyp.substr(0,7) == 'Mozilla')
                  {
                     //alert("Netscape!");
                  
                     BrowserName = 'Netscape';
                  
                     if (BrowserTyp.substr(0,11) < 'Mozilla/5.0')
                     {
                        Pfeil_Headline = 0;
                     }
                     // mal hoffen, dass neuere Netscapes scrollen koennen...
                     else
                     {
                        Pfeil_Headline = 1;
                     }
                  }
                  else
                  {
                     BrowserName = 'Netscape';
                     Pfeil_Headline = 0;
                  }
               }
      
   return;

// Browserabfrage 
   var bV=parseInt(navigator.appVersion);
   var NS4=(document.layers) ? true : false;
   var IE4=((document.all)&&(bV>=4))?true:false;

// Laden der Stylesheets 
/*   if (NS4) 
   {
      document.write ("<link rel=STYLESHEET type=text/css href=/style/style_ns2.css>");
   }
   else 
   {
      document.write ("<link rel=STYLESHEET type=text/css href=/style/style_ie2.css>");
   }
*/
}
/*************************************************************************/

/*************************************************************************/
function mouseoutMenuPunkte(MenuLayer) {

	//alert("mouseoutMenuPunkte: MenuLayer= " + MenuLayer);

   if (menuon)
   {
      if ((g = FndObj(MenuLayer)) !=null)
      {
         //alert("g= " + g);
         d  = (document.layers) ? g:g.style;
         d.visibility = Hide;
         //alert(MenuLayer + " ist hidden");
      }
      else
      {
         alert(MenuLayer + " nicht gefunden ");
      }
   }
   
   menuon = false;
	/*
	if ((navigator.appName == "Microsoft Internet Explorer") && (getExplorerVersion() < 4.5))
		return true;
	hideMenu(false, false);
	*/
	return true;
}

/*************************************************************************/

function FotoArrayFuellen(Ind,BildSrc,BildUnter) 
{
   //alert("Ind= " + Ind + " BildSrc= " + BildSrc + " BildUnter= " + BildUnter);
   
   Fotos[Ind][0] = BildSrc;
   Fotos[Ind][1] = BildUnter;

      // Preload images #########
      Img = new Image();
      Img.src = BildSrc;

   
   //alert(Fotos[Ind]);
}

/*************************************************************************/

function PreloadImages(FotoCount)
{
    i=1;
    
    for (var i = 1; i <= FotoCount; i++)
    {
       name = 'preload'+i;
       //alert("name= " + name);
       
       g = FndObj(name);
       //alert("g= " + g);

       if (g !=null)
      {
       //merkBild = g.src;
       
          g.src = "../images/"+Fotos[i][0];
          //alert("PreloadImages: g.src= " + g.src);
       //g.src = merkBild;
       }
    }

    g = FndObj('fotopreload');
    if (g !=null)
    {
       d  = (document.layers) ? g:g.style;
       //d.visibility = Hide;
    }

}

/*************************************************************************/

function SetFotoGross(Ind, FotoCount, BildSrc, Bildunterschrift, Rueck, Vor)
{
   //alert("SetFotoGross. Bild= " + Bild + " Bildunterschrift= " + Bildunterschrift);
   
   //alert(Fotos[Ind]);
   //alert("Rueck= " + Rueck + " Vor= " + Vor);
   
      Img = new Image();
      Img.src = BildSrc;
      //alert("Img.src= " + Img.src);
   
      g = FndObj('bildgross')
      
      if (g !=null)
      {
         d  = (document.layers) ? g:g.style;
         //d.visibility = Hide;
         g.width  = Img.width;
         g.height = Img.height;
         g.src    = Img.src;
         //alert(" ");
         //d.visibility = Show;
      }
      
      g = FndObj('bildunter')

      if (g !=null)
      {
         //setTimeout(g.firstChild.nodeValue = Bildunterschrift;,5000);
      }
      g.firstChild.nodeValue = Bildunterschrift;
      
      VorRueck(Ind, FotoCount, Rueck, Vor);

}


/*************************************************************************/
function aktVorRueck(vor_rueck, FotoCount, Rueck, Vor)
{
   // diese Funktion soll aus dem Vor-Rück-Balken den Fotonamen extrahieren
   //  und damit aus der Fototabelle den Index dieses Fotos ermitteln.
   //  Mit diesem Index wird dann die Funktion VorRueck aufgerufen, die im
   //  Vor-Rück-Balken das aktuelle Bild einträgt... 
   //  Je nach übergebenem vor_rueck Parameter wird dann entschieden, ob der Index des
   //  neu anzuzeigenden Bildes hoch- oder runtergezählt oder nicht verändert werden muss. 
   //  Das passiert in function VorRueck.

      var AktInd = -1;
      
      g = FndObj(vor_rueck);

      if (g !=null)
      {
			 var aktFoto = g.href;
			 var jpgPos = aktFoto.search(/jpg/);

			 if(jpgPos != -1)
			 {
				 zwiPos = jpgPos + 3;
				 zwiString = aktFoto.substring(0,zwiPos);

				 for (var i = zwiString.length - 1; i >= 0; i--)
				 {
					 if (zwiString.substr(i,1) == "/")
					 {
						 var FotoName = zwiString.substr(i+1);
						 i = 0;
					 }
				 }

				 for (var i = 1; i <= FotoCount; i++)
				 {
							if (FotoName == Fotos[i][0])
							{
								AktInd = i;
							}
				 }
			 }

			 if (AktInd != -1)
			 {
				 VorRueck(AktInd, FotoCount, vor_rueck, Rueck, Vor);
			 }
	 
      }
}

/*************************************************************************/

function VorRueck(Ind, FotoCount, Richtung, Rueck, Vor)
{
   //alert("VorRueck: Ind= " + Ind + " Richtung= " + Richtung);
      
      FotoVor   = 0;
      FotoRueck = 0;

// Vor Rück-Leiste füllen ############################
 
	if (Richtung == "linkrueck")
	{

		if (Ind > 1)
		{
			FotoLink = Ind - 1;
		}
		else
		{
			FotoLink = FotoCount;
		}
	}
	else
	{
		if (Richtung == "linkvor")
		{
			if (Ind < FotoCount)
			{
				FotoLink = Ind + 1;
			}
			else
			{
				FotoLink = 1;
			}
		}
		else
		{
			FotoLink = Ind;
		}
	}
	g = FndObj('linkrueck');

	if (g !=null)
	{
		//g.href = "javascript:SetFotoGross("+FotoRueck+","+FotoCount+",'../images/"+Fotos[FotoRueck][0]+"','"+Fotos[FotoRueck][1]+"','"+Rueck+"','"+Vor+"')";
		g.href = "../incl/fotoinframe.php?fotosrc=../images/"+Fotos[FotoLink][0]+"&fotounter="+Fotos[FotoLink][1];

	}

	g = FndObj('linkvor');

	if (g !=null)
	{
		//g.href = "javascript:SetFotoGross("+FotoVor+","+FotoCount+",'../images/"+Fotos[FotoVor][0]+"','"+Fotos[FotoVor][1]+"','"+Rueck+"','"+Vor+"')";
		g.href = "../incl/fotoinframe.php?fotosrc=../images/"+Fotos[FotoLink][0]+"&fotounter="+Fotos[FotoLink][1];
	}
}
/*************************************************************************/
function aktVorRueckGrafik(vor_rueck, FotoCount, Rueck, Vor, V)
{
   // diese Funktion soll aus dem Vor-Rück-Balken den Fotoindex extrahieren.
   //  Mit diesem Index wird dann die Funktion VorRueck aufgerufen, die im
   //  Vor-Rück-Balken das aktuelle Bild einträgt... 
   //  Je nach übergebenem vor_rueck Parameter wird dann entschieden, ob der Index des
   //  neu anzuzeigenden Bildes hoch- oder runtergezählt oder nicht verändert werden muss. 
   //  Das passiert in function VorRueck.

      var AktInd = -1;
      
      g = FndObj(vor_rueck);

      if (g !=null)
      {
			 var aktFoto = g.href;
			 var zwiPos = aktFoto.search(/gref=/);
			 
			 if(zwiPos != -1)
			 {
				 zwiStr  = aktFoto.substr(zwiPos);
				 zwiPos2 = zwiStr.search(/&/);
				 zwiLen  = zwiPos2 - 5;
				 zwiString = zwiStr.substr(5,zwiLen);
				 
				 AktInd = parseInt(zwiString);
			 }

			 if (AktInd != -1)
			 {
				 VorRueckGrafik(AktInd, FotoCount, vor_rueck, Rueck, Vor, V);
			 }
	 
      }
}

/*************************************************************************/

function VorRueckGrafik(Ind, FotoCount, Richtung, Rueck, Vor, V)
{
      
      FotoVor   = 0;
      FotoRueck = 0;

// Vor Rück-Leiste füllen ############################
 
	if (Richtung == "linkrueck")
	{

		if (Ind > 1)
		{
			FotoLink = Ind - 1;
		}
		else
		{
			FotoLink = FotoCount;
		}
	}
	else
	{
		if (Richtung == "linkvor")
		{
			if (Ind < FotoCount)
			{
				FotoLink = Ind + 1;
			}
			else
			{
				FotoLink = 1;
			}
		}
		else
		{
			FotoLink = Ind;
		}
	}
	g = FndObj('linkrueck');

	if (g !=null)
	{
		g.href = "../incl/grafikinframe.php?gref="+FotoLink+"&verz="+V;
	}

	g = FndObj('linkvor');

	if (g !=null)
	{
		g.href = "../incl/grafikinframe.php?gref="+FotoLink+"&verz="+V;
	}
}

/*************************************************************************/

function mouseonMenuPunkte(MenuLayer) {

//alert("mouseonMenuPunkte: MenuLayer= " + MenuLayer + " menuon= " + menuon);

   if (!menuon)
   {
      if ((g = FndObj(MenuLayer)) !=null)
      {
         //alert("g= " + g);
         d  = (document.layers) ? g:g.style;
         d.visibility = Show;
         //alert(MenuLayer + " ist hidden");
      }
      else
      {
         alert(MenuLayer + " nicht gefunden ");
      }
   
      menuon = true;
   }
	/*
	if ((navigator.appName == "Microsoft Internet Explorer") && (getExplorerVersion() < 4.5))
		return true;
	hideMenu(false, false);
	*/
	return true;
}



/*************************************************************************/

function Fehlermeld(fmeldung)
{
   if (FString.length > 1)
   {
      FString = FString + '\n' + fmeldung;
   }
   else
   {
      FString = fmeldung;
   }
   
   //alert(FString);
}

/*************************************************************************/

function checkForm(FormTyp) 
{
    var keineAnrede = true;
    var Fehler = false;
    FString = '';

    fmeld = new Array(4);
    fmeld[0] = new Array(8); // deutsch
    fmeld[1] = new Array(8); // english
    fmeld[2] = new Array(8); // francais
    fmeld[3] = new Array(8); // espanol
    
    fmeld[0][0] = "Bitte geben Sie Ihren Namen oder den Namen Ihrer Firma ein";
    fmeld[1][0] = "Please enter your name or company name";
    fmeld[2][0] = "Veuillez entrer votre nom ou le nom de votre entreprise s.v.p.";
    fmeld[3][0] = "Por favor, inserte su nombre o el nombre de su empresa";
    
    fmeld[0][1] = "Bitte geben Sie eine E-Mail Adresse oder Telefonnumer ein";
    fmeld[1][1] = "Please enter either an email address or a telephone number";
    fmeld[2][1] = "Veuillez entrer votre courriel ou numéro de téléphone s.v.p.";
    fmeld[3][1] = "Por favor, inserte su dirección de correo electronico o su número de teléfono";
    
    fmeld[0][2] = "Bitte geben Sie eine gültige E-Mail Adresse ein";
    fmeld[1][2] = "Please enter a valid email address";
    fmeld[2][2] = "Entrez un courriel valable s.v.p.";
    fmeld[3][2] = "Por favor, inserte una dirección de correo electronico válida";
    
    fmeld[0][3] = "Bitte geben Sie eine gültige Telefonnummer ein";
    fmeld[1][3] = "Please enter a valid telephone number";
    fmeld[2][3] = "Entrez un numéro de téléphone valable s.v.p.";
    fmeld[3][3] = "Por favor, inserte un número de teléfono válido";
    
    fmeld[0][4] = "Bitte geben Sie eine Nachricht ein";
    fmeld[1][4] = "Please enter a message";
    fmeld[2][4] = "Veuillez entrer votre message s.v.p.";
    fmeld[3][4] = "Por favor, inserte su mensaje";
    
    fmeld[0][5] = "Bitte wählen Sie eine Anrede aus";
    fmeld[1][5] = "Please choose a title";
    fmeld[2][5] = "Veuillez choisir un titre s.v.p.";
    fmeld[3][5] = "Seleccione un tratamiento por favor";
    
    fmeld[0][6] = "Bitte geben Sie den Prüfcode ein";
    fmeld[1][6] = "Please enter the anti-spam code";
    fmeld[2][6] = "Veuillez entrer le code anti-spam s.v.p.";
    fmeld[3][6] = "Por favor inserte el código anti-spam";

    
    UrlString = window.location.href;
    //alert("UrlString= " + UrlString);
    if(UrlString.search('deutsch') > -1)
    {
       langind = 0;
    }
    else
    if(UrlString.search('english') > -1)
    {
       langind = 1;
    }
    else
    if(UrlString.search('francais') > -1)
    {
       langind = 2;
    }
    else
    if(UrlString.search('espanol') > -1)
    {
       langind = 3;
    }
    else
    {
       alert("checkForm: Falsches Verzeichnis! " + UrlString);
       return false;
    }
    //alert("langind= " + langind + " UrlString= " + UrlString);

    if(document.emailForm.Anrede[0].checked == true
    || document.emailForm.Anrede[1].checked == true
    || document.emailForm.Anrede[2].checked == true)
    {
    }
    else
    {
       Fehlermeld(fmeld[langind][5]);
       if (!Fehler)
       {
          document.emailForm.Anrede[0].focus();
          Fehler = true;
       }
    }

    if(document.emailForm.NameVName.value == "" && document.emailForm.Firma.value == "")
    {
       Fehlermeld(fmeld[langind][0]);
       if (!Fehler)
       {
          document.emailForm.NameVName.focus();
          Fehler = true;
       }
    }

    if(document.emailForm.Email.value == "" && document.emailForm.Telefon.value == "")
    {
       Fehlermeld(fmeld[langind][1]);
       if (!Fehler)
       {
          document.emailForm.Email.focus();
          Fehler = true;
       }
    }

    if(document.emailForm.Email.value != "")
    {
       addr = document.emailForm.Email.value;

       // Split on at and dot sign
       bits  = addr.split("@");
       bits2 = addr.split(".");

       // Check if length is less than 2
       if (bits.length < 2 || bits2.length < 2) 
       {
          Fehlermeld(fmeld[langind][2]);
          if (!Fehler)
          {
	     document.emailForm.Email.focus();
	     Fehler = true;
          }
       } 
    }

    if(document.emailForm.Telefon.value != "")
    {
       telnr2 = " ";
       telnr = document.emailForm.Telefon.value;
       //alert("telnr= " + telnr);
       
       while(telnr2 != telnr)
       {
          telnr2 = telnr;
          telnr = telnr.replace(/ /,"");
          telnr = telnr.replace(/\//,"");
          telnr = telnr.replace(/-/,"");
          telnr = telnr.replace(/\+/,"");
          telnr = telnr.replace(/\./,"");
          //alert("telnr= " + telnr);
       }
       
       if(isNaN(telnr) == true)
       {
          Fehlermeld(fmeld[langind][3]);
          if (!Fehler)
          {
	     document.emailForm.Telefon.focus();
	     Fehler = true;
          }
       } 
    }
    
    if (FormTyp == "KontaktForm")
    {
		 if(document.emailForm.Mailtext.value == "")
		 {
			 Fehlermeld(fmeld[langind][4]);
			 if (!Fehler)
			 {
				 document.emailForm.Mailtext.focus();
				 Fehler = true;
			 }
		 }
    }
    
    if(document.emailForm.PruefCode.value == "")
    {
       Fehlermeld(fmeld[langind][6]);
       if (!Fehler)
       {
          document.emailForm.PruefCode.focus();
          Fehler = true;
       }
    }
    
    /* Persönliche Daten prüfen Ende **************************************************/
    
    if (Fehler)
    {
       alert(FString);
       return false;
    }
    else
    {
       //FMail = window.open("","MailWindow","resizable=no,width=460,height=430,screenX=0,screenY=0,status=no,scrollbars=no");	
       //FMail.focus();
       
       return true;
    }

}

/*************************************************************************/

function SetWindowTitle(titel)
{
   top.document.title = "Katrina Francke Software >>  " + titel + " - -";
   

}

/*************************************************************************/

function neuAufbauP()
{
   //alert ("neuAufbauP");
   
   //DHTML_init();
   InitBackground();

}

/******************************************************************************/
/* t = Height oder Width, a = aus welchem Objekt */
function P7_getHW(t,a)
{ //v2.01 by PVII
  var r, p, h = 0, w = 0;

  if ((p = FndObj(a)) !=null)
  {
     if (document.all || document.getElementById)
     {
        h = parseInt(p.offsetHeight);
        w = parseInt(p.offsetWidth);

        if (!h)
        {
           h = parseInt(p.style.pixelHeight);
           w = parseInt(p.style.pixelWidth);
        }
     }

     else
        if (document.layers)
        {
           h = parseInt(p.clip.height);
           w = parseInt(p.clip.width);
        }
  }
  if (t == "width")
  {
     r = w;
  }
  else
  {
     r = h;
  }

  return r;
}

/*************************************************************************/

function SetFensterName(WName)
{
	top.name = WName;

	/*if (WName == 'WWeb')
	{
	   LOvrlp = 520;
	   ProgDif = 20;
	}
	else if (WName == 'WProg')
	     {
	        LOvrlp = 50;
	        ProgDif = 50; // 50 Pixel nach links 
	     }
	else if (WName == 'WInicio')
	     {
	        LOvrlp = 50;
	        ProgDif = 30; // 30 Pixel nach links 
	     }
	else
	{
	   alert("SetFensterName. Falscher Fenstername: " + WName);
	}*/

}

/*************************************************************************/

function LeftposLayerMiddle()
{
   w_F  = Fensterweite();
   
   w_L   = ((w_F - w_LM) / 2) - ProgDif; // Breite des linken Layers (width_LayerLeft)
   
   if (w_L < 0)
   {
      w_L = 0;
   }
   
   return w_L;

}

/*************************************************************************/

function InitBackground()
{
   
   //alert("InitBackground: DOM= " + DOM);
   if (DOM)
   {
      
      FWidth  = Fensterweite();
      //alert("FWidth= " + FWidth);

      w_LL = LeftposLayerMiddle();
      
      
      w_LR = (FWidth - w_LM) / 2 + LOvrlp + ProgDif;// Breite des rechten Layers (width_LayerRight)
                                                // bei Webdes überlappen lassen, damit der
                                                // Scrolltext versteckt wird
      
      if (w_LR < 0)
      {
         w_LR = 0;
      }
      
      //p_LR  = (FWidth - w_LM) / 2 + w_LM - 10;  // Pos_LayerRight 10 Pixel überlappen lassen
      //p_LR  = (FWidth - w_LM) / 2 + w_LM;
      //alert("1. p_LR= " + p_LR);
      
      p_LR  = w_LL + w_LM;
      //alert("2. p_LR= " + p_LR);
      
      if (p_LR < 0)
      {
         p_LR = 0;
      }
      
      LHeight = Fensterhoehe();

      /* middle piece with table and texts */
      if ((g = FndObj('bglayermiddle')) !=null)
      {
         d  = (document.layers) ? g:g.style;
         LHeight = parseInt(d.height); // Hoehe Seitenstuecke = Hoehe Mittelteil
         //alert("bglayermiddle: LHeight= " + LHeight);
      }

      /* border at left side of window */
      if ((g = FndObj('bglayerleft')) !=null)
      {
         d  = (document.layers) ? g:g.style;
         d.left   = "0px";
         d.top    = "0px";
         d.width  = w_LR+"px";
         d.height = LHeight+"px";
         //alert("bglayerleft: d.height= " + d.height);
      }
      else
      {
      	//alert("bglayerleft nicht gefunden");
      }

      /* middle piece with table and texts */
      if ((g = FndObj('bglayermiddle')) !=null)
      {
         d  = (document.layers) ? g:g.style;
         d.left   = w_LL+"px";
         d.top    = "0px";
         d.width  = w_LM+"px";
         //alert("bglayermiddle: d.left= " + d.left + " d.width= " + d.width + " d.height= " + d.height);
         //d.height = LHeight+"px";
      }
      else
      {
      	//alert("bglayermiddle nicht gefunden");
      }

      /* bright border at right side of window */
      if ((g = FndObj('bglayerright')) !=null)
      {
         //alert("bglayerright positionieren");
         d  = (document.layers) ? g:g.style;
         d.left   = p_LR+"px";
         d.top    = "0px";
         d.width  = w_LR+"px";
         d.height = LHeight+"px";
         //alert("bglayerright: d.left= " + d.left + " d.width= " + d.width + " d.height= " + d.height);
      }
      else
      {
      	//alert("bglayerright nicht gefunden");
      }
   
   }
   else
   {
      //alert("nicht DOM!");
   }

}

/*************************************************************************/

function DownloadProfil()
{
      
     /* if (Pfeil_Headline)
      {
         FP = window.open("profil.pdf","hauptunten");
      }
      else
      { */
         FP = window.open("profil.pdf","profilwindow");
     // }

}  /* function BildOeffnenProfil */

/*************************************************************************/

function ProfilDrucken()
{
      BrowserAbfrage();
      
      //alert("BrowserName= " + BrowserName);
      
      if (BrowserName == 'Internet Explorer')
      {
         FPr = window.open("profil.htm","msprint","width=1,height=1,left=1,top=1");
         FPr.print();
         FPr.close();
      }
      else
      {
         top.frames[2].hauptunten.print();
      }

}  

/*************************************************************************/

function BildOeffnen(Bild,W,H)
{
	//alert("FQ= " + FQ + " FH= " + FH);
	FensterOeffnen = true;
	
	W = W + 20;
	H = H + 20;

	if(W > H)
	{
		if (!FQ || FQ.closed == true)
		{
			//alert("undef. od. geschl.: FQ= " + FQ);
			FQX = 60;
			FQY = 30;
		}
		else
		{
			//alert("offen: FQ= " + FQ);
			if (FQ.screenX)
			{
			   FQX = FQ.screenX;
			}
			else
			{
			   FQX = 60;
			}
			
			if (FQ.screenY)
			{
			   FQY = FQ.screenY;
			}
			else
			{
			   FQY = 30;
			}			
	
			if (merkQW != W
			||  merkQH != H)
			{
				FQ.close();

				merkQW = W;
				merkQH = H;
			}
			else
			{
				FensterOeffnen = false;
			}
		}
		
		if (FensterOeffnen)
		{
			//alert("Querfenster ist geschlossen! FQX = " + FQX + " FQY = " + FQY);
			FQ = window.open(Bild,"QuerFenster","resizable=yes,width=" + W + ",height=" + H + ",screenX=" + FQX + ",screenY=" + FQY );
			//alert("FQ= " + FQ);

			if (!FQ)
	 	   	{
	    			//alert("Pop up windows are suppressed on your computer!");
				return;
			}
		}
		else
		{
			//alert("Querfenster ist offen! FQX = " + FQX + " FQY = " + FQY);
			FQ.document.images[0].src = Bild;
		}
		FQ.focus();
	}
	
    	else
	{
		if (!FH || FH.closed == true)
		{
			FHX = 60;
			FHY = 30;
		}
		else
		{
			if (FH.screenX)
			{
			   FHX = FH.screenX;
			}
			else
			{
			   FHX = 60;
			}
			
			if (FH.screenY)
			{
			   FHY = FH.screenY;
			}
			else
			{
			   FHY = 30;
			}			
	
			if (merkHW != W
			||  merkHH != H)
			{
				merkHW = W;
				merkHH = H;
				
				FH.close();
			}
			else
			{
				FensterOeffnen = false;
			}
		}
		
		if (FensterOeffnen)
		{
			//alert("Hochfenster ist geschlossen! FHX = " + FHX + " FHY = " + FHY);
			FH = window.open(Bild,"HochFenster","resizable=yes,width=" + W + ",height=" + H + ",screenX=" + FHX + ",screenY=" + FHY );
		

			if (!FH)
	 	   	{
	    			//alert("Pop up windows are suppressed on your computer!");
				return;
			}
		}
		else
		{
			//alert("Hochfenster ist offen! FHX = " + FHX + " FHY = " + FHY);
			FH.document.images[0].src = Bild;
		}
		
		FH.focus();
	}
   }

/*************************************************************************/
function FndObj(n, d)
{ //v4.01
   var p, i, x;

   /*if (n == 'fotorueck')
   {
      alert("FndObj: n= " + n);
   }*/

   if (!d)
      d = document;

   // Auf übergeordnete Frames mit Parameterübergabe prüfen?
   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];

      /*if (x)
      {
         alert("1 n= " + n + " x= " + x);
      }*/


   for (i = 0; !x && i < d.forms.length; i++)
      x = d.forms[i][n];

      /*if (x)
      {
         alert("2 n= " + n + " x= " + x);
      }*/

   for (i = 0; !x  && d.layers && i < d.layers.length;i++)
      x = FndObj(n,d.layers[i].document);

      /*if (x)
      {
         alert("3 n= " + n + " x= " + x);
      }*/

   if (!x && d.getElementById)
      x = d.getElementById(n);

      /*if (x)
      {
         alert("4 n= " + n + " x= " + x);
      }*/


   return x;
}

