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 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 = 0; 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 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 VorRueck(Ind, FotoCount, Rueck, Vor)
{
   	
      FotoVor   = 0;
      FotoRueck = 0;

// Vor Rück-Leiste füllen ############################
 
	if (Ind > 1)
	{
		FotoRueck = Ind - 1;
	}
	else
	{
		FotoRueck = FotoCount;
	}
	if (Ind < FotoCount)
	{
		FotoVor = Ind + 1;
	}
	else
	{
		FotoVor = 1;
	}


      g = FndObj('linkrueck');

      if (g !=null)
      {
	  g.href = "javascript:SetFotoGross("+FotoRueck+","+FotoCount+",'../images/"+Fotos[FotoRueck][0]+"','"+Fotos[FotoRueck][1]+"','"+Rueck+"','"+Vor+"')";
      }

      g = FndObj('linkvor');

      if (g !=null)
      {
	  g.href = "javascript:SetFotoGross("+FotoVor+","+FotoCount+",'../images/"+Fotos[FotoVor][0]+"','"+Fotos[FotoVor][1]+"','"+Rueck+"','"+Vor+"')";
      }
}

/*************************************************************************/

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() 
{
    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 ein";
    fmeld[1][0] = "Please enter your name";
    fmeld[2][0] = "Veuillez entrer votre nom s.v.p.";
    fmeld[3][0] = "Por favor, inserte su nombre";
    
    fmeld[0][1] = "Bitte geben Sie Ihre E-Mail Adresse oder Telefonnumer ein";
    fmeld[1][1] = "Please enter either your email address or your 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 einen Text ein";
    fmeld[1][4] = "Please enter a text";
    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 wählen Sie mindestens eines der Häuser";
    fmeld[1][6] = "Please choose at least one of the houses";
    fmeld[2][6] = "Veuillez choisir au moins une des maisons s.v.p.";
    fmeld[3][6] = "Por favor, seleccione por lo menos una de las casas";
    
    fmeld[0][7] = "Bitte geben Sie die Anzahl Personen ein (max. 6)";
    fmeld[1][7] = "Please enter the number of persons (max. 6)";
    fmeld[2][7] = "Veuillez entrer le nombre de personnes s.v.p. (max. 6)";
    fmeld[3][7] = "Por favor, inserte el número de personas (max. 6)";
    
    fmeld[0][8] = "Bitte geben Sie den Buchungszeitraum ein (Datum Format: 31 12 2007)";
    fmeld[1][8] = "Please enter the booking period (date format: 01 12 2007)";
    fmeld[2][8] = "Veuillez entrer les dates de réservation s.v.p. (format de date: 31 12 2007)";
    fmeld[3][8] = "Por favor, inserte el plazo de reservación (formato de fecha: 31 12 2007)";
    
    fmeld[0][9] = "Bitte geben Sie einen gültigen Buchungszeitraum ein (Datum Format: 31 12 2007)";
    fmeld[1][9] = "Please enter a valid booking period (date format: 31 12 2007)";
    fmeld[2][9] = "Veuillez entrer des dates de réservation valides s.v.p. (format de date: 31 12 2007)";
    fmeld[3][9] = "Por favor, inserte un plazo válido de reservación (formato de fecha: 31 12 2007)";

    
    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 == "")
    {
       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(/ /,"");
          //alert("telnr= " + telnr);
       }
       
       if(isNaN(telnr) == true)
       {
          Fehlermeld(fmeld[langind][3]);
          if (!Fehler)
          {
	     document.emailForm.Telefon.focus();
	     Fehler = true;
          }
       } 
    }

    if(document.emailForm.AnzahlPersonen.value == ""
    || document.emailForm.AnzahlPersonen.value > "6"
    || document.emailForm.AnzahlPersonen.value < "1")
    {
          Fehlermeld(fmeld[langind][7]);
          if (!Fehler)
          {
	     document.emailForm.AnzahlPersonen.focus();
	     Fehler = true;
          }
    }

    
    if(document.emailForm.Casa_La_Fuente.checked == false
    && document.emailForm.Casa_La_Loma.checked   == false)
    {
          Fehlermeld(fmeld[langind][6]);
          if (!Fehler)
          {
	     document.emailForm.Casa_La_Fuente.focus();
	     Fehler = true;
          }
    }
    
    T_v = document.emailForm.Tag_von.value;
    M_v = document.emailForm.Monat_von.value;
    J_v = document.emailForm.Jahr_von.value;
    T_b = document.emailForm.Tag_bis.value;
    M_b = document.emailForm.Monat_bis.value;
    J_b = document.emailForm.Jahr_bis.value;
    
    if (T_v.length < 2) { T_v = "0"+T_v; }
    if (M_v.length < 2) { M_v = "0"+M_v; }
    if (J_v.length < 3) { J_v = "20"+J_v; }
    if (T_b.length < 2) { T_b = "0"+T_b; }
    if (M_b.length < 2) { M_b = "0"+M_b; }
    if (J_b.length < 3) { J_b = "20"+J_b; }
    
    var FehlerNeu = true;
    
    if(T_v == ""
    || M_v == ""
    || J_v == ""
    || T_b == ""
    || M_b == ""
    || J_b == "")
    {
          if (FehlerNeu == true)
          {
		  Fehlermeld(fmeld[langind][8]);
		  if (!Fehler)
		  {
		     document.emailForm.Tag_von.focus();
		     Fehler = true;
		  }
          FehlerNeu = false
          }
    }
    else
    {
    	if (!DatumKorrekt(T_v, M_v, J_v))
    	{
		Fehlermeld(fmeld[langind][9]);
		//alert("1");
		if (!Fehler)
		{
			//document.emailForm.Tag_von.focus();
			Fehler = true;
		}
		FehlerNeu = false;
    	}
    	if (!DatumKorrekt(T_b, M_b, J_b))
    	{
          if (FehlerNeu == true)
          {
		Fehlermeld(fmeld[langind][9]);
		//alert("2");
		if (!Fehler)
		{
			//document.emailForm.Tag_bis.focus();
			Fehler = true;
		}
		FehlerNeu = false;
	   }
    	}
    	else
    	{
    		if (J_v+M_v+T_v >= J_b+M_b+T_b)
    		{
          	   if (FehlerNeu == true)
          	   {
			Fehlermeld(fmeld[langind][9]);
			//alert("3");
			if (!Fehler)
			{
				//document.emailForm.Tag_bis.focus();
				Fehler = true;
			}
		   FehlerNeu = false;
		   }
    		}
    	}
    }

    /* Persönliche Daten prüfen Ende **************************************************/
    
    //alert("Fehler= " + Fehler);
    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 DatumKorrekt(tag,monat,jahr)
{
   ok = true;
   //alert("Tag=" + tag + " Monat= " + monat + " Jahr= " + jahr);

   
   switch(monat) 
   {
      case "01":
      case "03":
      case "05":
      case "07":
      case "08":
      case "10":
      case "12":
         if (tag > 31) { ok = false; }
      break;

      case "02":
         if (tag == 29) 
         { 
            if (jahr % 4 != 0)
            ok = false; 
         }
         else if (tag > 29) { ok = false; }
      break;
      
      case "04":
      case "06":
      case "09":
      case "11":
         if (tag > 30) { ok = false; }
      break;

      default:
      //alert("function DatumKorrekt. Falsche Parameter: Tag=" + tag + " Monat= " + monat + " Jahr= " + jahr);
      ok = false;
      break;		
   }

   if (ok == true)
   {
      var jetzt = new Date();
      //alert("jetzt=" + jetzt);
      var Jahr  = String(jetzt.getFullYear());
      var M = jetzt.getMonth();
      M++;
      var Monat = String(M);
      if (Monat.length < 2) { Monat = "0"+Monat; }
      
      var Tag   = String(jetzt.getDate());
      if (Tag.length < 2) { Tag = "0"+Tag; }

      //alert(jahr + " " + monat + " " + tag + " < " +Jahr + " " + Monat + " " + Tag);
      if (jahr+monat+tag < Jahr+Monat+Tag)
      {
         ok = false;
      }
      
   }

   return ok;
   
}


/*************************************************************************/

function SetWindowTitle(titel)
{
   top.document.title = "www.andalucia-holiday.de >>  " + 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;
}


