
var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0;

var merkQW = 0;
var merkQH = 0;
var merkHW = 0;
var merkHH = 0;

var FQ;
var FH;
var FG;
var F1;
var FBf;
var FBc;
var F2;

var FString = ' ';

var alt_y = 0;
//alert("alt_y= " + alt_y);
var Pfeil_Headline = 0;
var BrowserName    = ' ';
var BrowserVersion = ' ';
var MSIE = false;
var vorPfeil       = 0;
var voidImg    = 0;
var voidFImg   = 8;
var DivNameAlt = '';

var AnzTextLayers = 0;
var AnzMenuTopics = 0;

var MenuTopicAlt = '';
var TextList      = new Array();

/*************************************************************************/
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;

}

/*************************************************************************/

function DHtml()
{
   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;
   }   
}

/*************************************************************************/

function CheckFrame()
{
   var UrlString = '';
   var FraName   = '';
   
   if (window.name == "FS1Oben"
   ||  window.name == "FS1Unten" )
   {
   }
   else
   {
      UrlString = window.location.href;
      
      if(UrlString.search('menutop.htm') > -1)
      {
         FraName = "../inicio.htm";
      }
      if(UrlString.search('alquiler.htm') > -1)
      {
         FraName = "alquiler_fra.htm";
      }
      if(UrlString.search('construct.htm') > -1)
      {
         FraName = "construct_fra.htm";
      }
      if(UrlString.search('contact.htm') > -1)
      {
         FraName = "contact_fra.htm";
      }
      if(UrlString.search('intro.htm') > -1)
      {
         FraName = "intro_fra.htm";
      }

      window.location.href = FraName;
   }


}

/*************************************************************************/

function neuAufbau()
{
   //alert("neuAufbau");
   
   DivName    = DivNameAlt;
   DivNameAlt = '';

  if (Weite != Fensterweite())
  {
     //window.history.go(0);
     InitBackground();
  }
   
}

/*************************************************************************/

function InitBackground()
{
   
   if (DOM)
   {
      FWidth  = Fensterweite();
      //alert("FWidth= " + FWidth);
      
      pleft   = (FWidth - 800) / 2;
      if (pleft < 0)
      {
         pleft = 0;
      }
      wrl     = (FWidth - 800) / 2 + 50;        // 50 Pixel überlappen lassen, weil sonst 
                                                // manche Internet Explorer rechts einen weißen 
                                                // Sreifen lassen
      if (wrl < 0)
      {
         wrl = 0;
      }
      pright  = (FWidth - 800) / 2 + 800 - 10;  // 10 Pixel überlappen lassen
      if (pright < 0)
      {
         pright = 0;
      }
      FHeight = Fensterhoehe();

      /* middle piece with table and texts */
      if ((g = FndObject('bglayermiddle')) !=null)
      {
         d  = (document.layers) ? g:g.style;
         FHeight = parseInt(d.height); // Hoehe Seitenstuecke = Hoehe Mittelteil
      }

      /* orange border at left side of window */
      if ((g = FndObject('bglayerleft')) !=null)
      {
         d  = (document.layers) ? g:g.style;
         d.left   = "0px";
         d.top    = "0px";
         d.width  = wrl+"px";
         d.height = FHeight+"px";
      }

      /* bright border at right side of window */
      if ((g = FndObject('bglayerright')) !=null)
      {
         d  = (document.layers) ? g:g.style;
         d.left   = pright+"px";
         d.top    = "0px";
         d.width  = wrl+"px";
         d.height = FHeight+"px";
      }

      /* middle piece with table and texts */
      if ((g = FndObject('bglayermiddle')) !=null)
      {
         d  = (document.layers) ? g:g.style;
         d.left   = pleft+"px";
         d.top    = "0px";
         d.width  = "800px";
         //d.height = FHeight+"px";
      }
   
   }
   else
   {
      //alert("nicht DOM!");
   }

}

/*************************************************************************/

function Fehlermeld(fmeldung)
{
   if (FString.length > 1)
   {
      FString = FString + '\n' + fmeldung;
   }
   else
   {
      FString = fmeldung;
   }
   
   //alert(FString);
}

/*************************************************************************/

function checkBookingForm() 
{
    //alert("checkFormWeb");
    
    var VglDatumVon   = '';
    var VglDatumBis   = '';
    
    var SuperficieVon = '';
    var SuperficieBis = '';
    
    var tag   = 0;
    var monat = 0;
    var jahr  = 0;
    
    var Fehler = false;
    FString = '';
    
    fmeld = new Array(4);
    fmeld[0] = new Array(25); // english
    fmeld[1] = new Array(25); // deutsch
    fmeld[2] = new Array(25); // espanol
    
    fmeld[0][0] = "Please choose a title";
    fmeld[1][0] = "Bitte wählen Sie eine Anrede aus";
    fmeld[2][0] = "Seleccione un título por favor";
    
    fmeld[0][1] = "Please enter your name";
    fmeld[1][1] = "Bitte geben Sie Ihren Namen ein";
    fmeld[2][1] = "Introduzca su nombre y apellidos por favor";
    
    fmeld[0][2] = "Please enter your address";
    fmeld[1][2] = "Bitte geben Sie Ihre Adresse ein";
    fmeld[2][2] = "Introduzca su direción por favor";
    
    fmeld[0][3] = "Please enter either an email address or a telephone number";
    fmeld[1][3] = "Bitte geben Sie eine E-Mail Adresse oder Telefonnumer ein";
    fmeld[2][3] = "Introduzca su dirección de su correo electrónico o su número de teléfono por favor";
    
    fmeld[0][4] = "Please enter a valid email address";
    fmeld[1][4] = "Bitte geben Sie eine gültige E-Mail Adresse ein";
    fmeld[2][4] = "Introduzca una dirección de correo electrónico válida por favor";
    
    fmeld[0][5] = "Please enter a valid telephone number";
    fmeld[1][5] = "Bitte geben Sie eine gültige Telefonnummer ein";
    fmeld[2][5] = "Introduzca un número de teléfono válido por favor";
    
    fmeld[0][6] = "Please enter your date of holiday required";
    fmeld[1][6] = "Bitte geben Sie Ihr Urlaubsdatum ein";
    fmeld[2][6] = "Introduzca el período de sus vacaciones por favor";
    
    fmeld[0][7] = "Please enter the number of persons";
    fmeld[1][7] = "Bitte geben Sie die Anzahl der Mitreisenden an";
    fmeld[2][7] = "Introduzca el número de personas por favor";
    
    fmeld[0][8] = "Please enter the names of persons";
    fmeld[1][8] = "Bitte geben Sie die Namen der Mitreisenden an";
    fmeld[2][8] = "Introduzca los nombres de personas por favor";
    
    fmeld[0][9] = "Please choose your accommodation";
    fmeld[1][9] = "Bitte kreuzen Sie eine oder mehrere Unterkünfte an";
    fmeld[2][9] = "Elija su alojamiento por favor";
    
    fmeld[0][10] = "How much have you paid?";
    fmeld[1][10] = "Wieviel haben Sie angezahlt?";
    fmeld[2][10] = "¿Cuanto ha anticipado?";
    
    fmeld[0][11] = "Please enter the date of payment";
    fmeld[1][11] = "Bitte geben Sie das Zahlungsdatum ein";
    fmeld[2][11] = "Introduzca la fecha del pago";
    
    fmeld[0][12] = "Please accept our Booking Terms & Conditions";
    fmeld[1][12] = "Bitte erklären Sie sich mit den Buchungsbedingungen einverstanden";
    fmeld[2][12] = "Accepte las Condiciones de Reserva por favor";
    
    fmeld[0][13] = "Additional accommodation can only be booked with the main house";
    fmeld[1][13] = "Die Zusatzunterkunft kann nur mit dem Haupthaus gebucht werden";
    fmeld[2][13] = "El alojamiento adicional se puede reservar solament con la casa pricipal";

    
    UrlString = window.location.href;
    //alert("UrlString= " + UrlString);
    if(UrlString.search('english') > -1)
    {
       langind = 0;
    }
    else
    if(UrlString.search('deutsch') > -1)
    {
       langind = 1;
    }
    else
    if(UrlString.search('espanol') > -1)
    {
       langind = 2;
    }
    else
    {
       alert("checkForm: Falsches Verzeichnis! " + UrlString);
       return false;
    }

    /* Personal Data *******************************************************/

    if(document.emailForm.client_name.value == ""
    || document.emailForm.client_name.value.length < 5)
    {
       Fehlermeld(fmeld[langind][1]);
       if (!Fehler)
       {
          document.emailForm.client_name.focus();
          Fehler = true;
       }
    }

    if(  (document.emailForm.client_address.value == ""
       && document.emailForm.client_address2.value == "") 
    || document.emailForm.client_address.value.length < 12)

    {
       Fehlermeld(fmeld[langind][2]);
       if (!Fehler)
       {
          document.emailForm.client_address.focus();
          Fehler = true;
       }
    }

    if(document.emailForm.client_phone.value != "")
    {
       telnr2 = " ";
       telnr = document.emailForm.client_phone.value;
       
       while(telnr2 != telnr)
       {
          telnr2 = telnr;
          telnr = telnr.replace(/ /,"");
          //alert("telnr= " + telnr);
       }
       
       if(isNaN(telnr) == true)
       {
          Fehlermeld(fmeld[langind][5]);
          if (!Fehler)
          {
             document.emailForm.client_phone.focus();
             Fehler = true;
          }
       } 
    }

    if(  (document.emailForm.client_email.value == "" 
       || document.emailForm.client_email.value.length < 9)
    &&   (document.emailForm.client_phone.value == ""
       || document.emailForm.client_phone.value.length < 9) )
    {
       Fehlermeld(fmeld[langind][3]);
       if (!Fehler)
       {
          document.emailForm.client_email.focus();
          Fehler = true;
       }
    }

    if(document.emailForm.client_email.value != "")
    {
       addr = document.emailForm.client_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][4]);
          if (!Fehler)
          {
             document.emailForm.client_email.focus();
             Fehler = true;
          }
       } 
    }

    /* Personal Data End **************************************************/
    
    if (Fehler)
    {
       alert(FString);
       return false;
    }

    /* Holiday Details *****************************************************/
    if(document.emailForm.date_of_holiday.value == "" )
    {
       Fehlermeld(fmeld[langind][6]);
       if (!Fehler)
       {
          document.emailForm.date_of_holiday.focus();
          Fehler = true;
       }
    }
    
    if(document.emailForm.number_of_persons.value == "" 
    || isNaN(document.emailForm.number_of_persons.value) == true)
    {
       Fehlermeld(fmeld[langind][7]);
       if (!Fehler)
       {
          document.emailForm.number_of_persons.focus();
          Fehler = true;
       }
    }
    
    if(document.emailForm.names_of_persons.value == "" 
    || document.emailForm.names_of_persons.value.length < 4)
    {
       Fehlermeld(fmeld[langind][8]);
       if (!Fehler)
       {
          document.emailForm.names_of_persons.focus();
          Fehler = true;
       }
    }
    
    if (Fehler)
    {
       alert(FString);
       return false;
    }

    /* Holiday Details Ende ************************************************/

    /* Accommodation *****************************************************/
    if(document.emailForm.HuertaGanga.checked == true)
    {
    }
    else
    {
       if (document.emailForm.AdditionalAccommodation.checked == true)
       {
          Fehlermeld(fmeld[langind][13]);
          if (!Fehler)
          {
             document.emailForm.HuertaGanga.focus();
             Fehler = true;
          }
       }
       else
       {
          Fehlermeld(fmeld[langind][9]);
          if (!Fehler)
          {
             document.emailForm.HuertaGanga.focus();
             Fehler = true;
          }
       }
    }
    
    if (Fehler)
    {
       alert(FString);
       return false;
    }
    
    /* Accommodation Ende ************************************************/

    /* Requirements *****************************************************/
    
    if(document.emailForm.Total_paid.value == "" 
    || isNaN(document.emailForm.Total_paid.value) == true)
    {
       Fehlermeld(fmeld[langind][10]);
       if (!Fehler)
       {
          document.emailForm.Total_paid.focus();
          Fehler = true;
       }
    }
    
    if(document.emailForm.Date_payment_made.value == "" 
    || document.emailForm.Date_payment_made.value.length < 6)
    {
       Fehlermeld(fmeld[langind][11]);
       if (!Fehler)
       {
          document.emailForm.Date_payment_made.focus();
          Fehler = true;
       }
    }
    
    /* Requirements Ende ************************************************/
   
    /* Booking Terms accepted *************************************************/
    if(document.emailForm.BookingTermsAccepted.checked != true)
    {
       Fehlermeld(fmeld[langind][12]);
       if (!Fehler)
       {
          document.emailForm.BookingTermsAccepted.focus();
          Fehler = true;
       }
    }
    
    /* Booking Terms accepted Ende ********************************************/

    if (Fehler)
    {
       alert(FString);
       return false;
    }
    else
    {
       F2 = window.open("","MailWindow","resizable=yes,width=400,height=470,screenX=0,screenY=0,status=no");	
       return true;
    }
   
}

/******************************************************************************/
function EraseConstruirReformarCasa()
{
   
   document.emailForm.Ya_tengo_la_licencia_de_obras[0].checked = false;
   document.emailForm.Ya_tengo_la_licencia_de_obras[1].checked = false;
   document.emailForm.Ya_tengo_los_planes_de_construccion[0].checked = false;
   document.emailForm.Ya_tengo_los_planes_de_construccion[1].checked = false;
   
   document.emailForm.Situacion_y_direccion_del_solar.value = "";

}

/******************************************************************************/
function EraseYaTengoSolar()
{
  // alert("EraseYaTengoSolar. " + document.emailForm.Ya_tengo_solar[0].checked
  // + " " + document.emailForm.Ya_tengo_solar[1].checked);
   
   document.emailForm.Ya_tengo_solar[0].checked = false;
   document.emailForm.Ya_tengo_solar[1].checked = false;
}

/******************************************************************************/
function EraseAlquilarCasa()
{
    //alert("EraseAlquilarCasa. DOM= " + DOM);

       /*for (var i = 0; i < document.emailForm.Me_interesa.length; i++)
       {
          document.emailForm.Me_interesa[i].checked = false;
       }*/

       document.emailForm.Casa_1.checked = false;
       document.emailForm.Casa_2.checked = false;
       document.emailForm.Apartamento_1.checked = false;
       document.emailForm.Apartamento_2.checked = false;
       document.emailForm.Apartamento_3.checked = false;
       document.emailForm.Apartamento_4.checked = false;
       document.emailForm.Otro.checked = false;

       
       document.emailForm.desde_dia.options[0].selected = true;
       document.emailForm.desde_mes.options[0].selected = true;
       document.emailForm.desde_ano.options[0].selected = true;
       document.emailForm.desde_fecha.checked = false;
       
       document.emailForm.hasta_dia.options[0].selected = true;
       document.emailForm.hasta_mes.options[0].selected = true;
       document.emailForm.hasta_ano.options[0].selected = true;
       document.emailForm.hasta_fecha.checked = false;

}

/******************************************************************************/

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;		
   }

   return ok;
   
}

/******************************************************************************/
function TagNachDat(TagBez)
{
		if (TagBez == "principios de")
		{
		   return "01";
		}
		else
		if (TagBez == "mediados de")
		{
		   return "15";
		}
		else
		if (TagBez == "finales de")
		{
		   return "28";
		}
		else
		{
		   return TagBez;
		}
}

/******************************************************************************/
function MonatNachDat(MonatBez)
{
		if (MonatBez == "enero")
		{
		   return "01";
		}
		else
		if (MonatBez == "febrero")
		{
		   return "02";
		}
		else
		if (MonatBez == "marzo")
		{
		   return "03";
		}
		if (MonatBez == "abril")
		{
		   return "04";
		}
		if (MonatBez == "mayo")
		{
		   return "05";
		}
		if (MonatBez == "junio")
		{
		   return "06";
		}
		if (MonatBez == "julio")
		{
		   return "07";
		}
		if (MonatBez == "agosto")
		{
		   return "08";
		}
		if (MonatBez == "septiembre")
		{
		   return "09";
		}
		if (MonatBez == "octubre")
		{
		   return "10";
		}
		if (MonatBez == "noviembre")
		{
		   return "11";
		}
		if (MonatBez == "diciembre")
		{
		   return "12";
		}
		else
		{
		   
		   alert("function MonatNachDat: Falscher Monat! " + MonatBez);
		   return "00";
		}
}

/******************************************************************************/
/* 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 = FndObject(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 SetHomeFensterName()
{
	top.name = "MeridaHome";

	BrowserAbfrage();
	
}

/*************************************************************************/

function Home()
{
        top.location.href = '../inicio.htm';


}

/*************************************************************************/

function AndereSprache(Sprache)
{
   
	switch(Sprache) 
	{
		case "deutsch":
		Verzeichnis = '../deutsch/';
		break;

		case "english":
		Verzeichnis = '../english/';
		break;

		case "espanol":
		Verzeichnis = '../espanol/';
		break;

 		default:
   		alert("AndereSprache, Falsche Sprache: " + Sprache);
   		break;		
	}

   //alert("Sprache= " + Sprache + " Verzeichnis= " + Verzeichnis);

        Url = top.FS1Unten.location.href;
        
        if (Url.search('intro') > -1)
        {
           Datei = 'intro_fra';
        }
        else
        if (Url.search('construct') > -1)
        {
           Datei = 'construct_fra';
        }
        else
        if (Url.search('contact') > -1)
        {
           Datei = 'contact_fra';
        }
        else
        if (Url.search('alquiler') > -1)
        {
           Datei = 'alquiler_fra';
        }
        else
        {
           alert("AndereSprache: Falsche Datei! " + Url);
        }
        
        //top.location.href = Verzeichnis+'merida_fra.htm';
        top.location.href = Verzeichnis+Datei+'.htm';
        /*alert("top.location.href= " + top.location.href
        +    " Datei= " + Datei + " Verzeichnis= " + Verzeichnis);*/

}

/*************************************************************************/

function Bildwechsel(Bildnr,Bildobjekt,MAction)
{
  /* if(MAction == "MUp")
   {
      alert("Bildwechsel: Bildnr= " + Bildnr + " Bildobjekt= " + Bildobjekt + " MAction= " + MAction);
   } */
   
   BNr   = Bildnr + voidImg;
   UpBNr = UpPos + voidImg;
   
   if (Bildnr != UpPos) /* UpPos hält fest, welches Angebot zuletzt angeklickt wurde */
   {
      if(MAction == "MUp")
      {
         if (UpPos != -1) /* Zuletzt angeklicktes Bild wieder auf normal setzen */
         {
	    window.document.images[UpBNr].src = BildMOut[UpPos].src;
	 }

         UpPos = Bildnr; /* Nr.des zuletzt angeklickten Angebotes speichern */
      }
      //alert("BNr= " + BNr);
      window.document.images[BNr].src = Bildobjekt.src;
   }

} 
/*************************************************************************/

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 //auskommentiert, da nicht alle Browser im alten Fenster ein neues Bild öffnen...
			||  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 ExtraInfosOpen(ExtraUrl)
{
   //alert("BookCondOpen");
   var WName = '';
   
   if (ExtraUrl == 'bookform.htm')
   {
      F1 = FBf;
      WName = 'WBookform';
   }
   else 
   if (ExtraUrl == 'bookcond.htm')
   {
      F1 = FBc;
      WName = 'WBookcond';
   }
   else 
   if (ExtraUrl == 'yoga.htm'
   ||  ExtraUrl == 'painting.htm')
   {
      F1 = FBc;
      WName = 'WProjects';
   }
   else
   {
      //alert("ExtraInfosOpen: Falscher Parameter: " + ExtraUrl);
      return;
   }

	if (!F1 || F1.closed == true)
	{
		F1X = screen.availWidth - 750;
		F1Y = 130;
		Hoehe = screen.availHeight - this.F1Y;
		
		if (Hoehe > 500)
		{
		   Hoehe = 500;
		}
	   	//alert("Fenster ist geschlossen! F1X = " + F1X + " F1Y = " + F1Y);
    		
    		/*F1 = window.open(ExtraUrl,WName,"resizable=yes,width=750,height=" + Hoehe + ",screenX=" + F1X + ",screenY=" + F1Y + ",scrollbars,status=yes");
		if (!F1)
	 	{
			return;
		}*/
    		
	}
	else
	{
		if (F1.screenX)
		{
		   F1X = F1.screenX;
		}
		else
		{
		   if (screen.availWidth >= 800)
		   {
		      F1X = screen.availWidth - 800;
		   }
		   else
		   {
		      F1X = 0;
		   }
		}
		
		if (F1.screenY)
		{
		   F1Y = F1.screenY;
		}
		else
		{
		   F1Y = 10;
		}			
		
	   	//alert("Fenster ist offen! F1X = " + this.F1X + " F1Y = " + this.F1Y);
	   	//F1.location.href = ExtraUrl;
	   	F1.close();
	   	//alert("F1= " + F1);
	}
	
	F1 = window.open(ExtraUrl,WName,"resizable=yes,width=750,height=" + Hoehe + ",screenX=" + F1X + ",screenY=" + F1Y + ",scrollbars,status=yes");
	if (!F1)
	{
		return;
	}
   
	   if (ExtraUrl == 'bookform.htm')
	   {
	      FBf = F1;
	   }
	   else 
	   if (ExtraUrl == 'bookcond.htm')
	   {
	      FBc = F1;
	   }
	   else 
	   if (ExtraUrl == 'yoga.htm'
	   ||  ExtraUrl == 'painting.htm')
	   {
	      FBc = F1;
	   }
	   else
	   {
	      alert("ExtraInfosOpen: Falscher Parameter: " + ExtraUrl);
	   }

    	F1.focus();

}

/*************************************************************************/

function AuswahlVorbelegen()
{
	
		switch(parent.hauptfenster.document.title) 
		{
			case "prog_fra":
			FunkNr = 0;
   			break;

			case "webdes_fra":
			FunkNr = 1;
   			break;

			case "projekt_fra":
			FunkNr = 2;
   			break;

			case "profil_fra":
			FunkNr = 3;
   			break;

			case "ueberm_fra":
			FunkNr = 4;
   			break;

			case "kontakt_fra":
			FunkNr = 5;
   			break;

			case "francke":
			FunkNr = 6;
   			break;

	 		default:
	   		alert("AuswahlVorbelegen, Falsche Funktion: " + parent.hauptfenster.document.title);
	   		break;		
		}

	Bildwechsel(FunkNr,BildMUp[FunkNr],'MUp');
}

/*************************************************************************/

function BlaetternHauptUndRechts(URL1,URL2) 
{
    parent.hauptfenster.location.href = URL1;
    parent.rechteleiste.location.href = URL2;
  }

/*************************************************************************/

function DownloadProfil()
{
      
     /* if (Pfeil_Headline)
      {
         FP = window.open("profil.pdf","hauptunten");
      }
      else
      { */
         FP = window.open("profil.pdf","profilwindow");
     // }

}  

/*************************************************************************/

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 DynamicLogo()
{
  var Logo;
  
  if((Logo = FndObject('dLogo')) !=null)
  {
      styleInfo = (document.layers)?g:g.style;
      var xLogo = (parseInt(styleInfo.left))?parseInt(d.left):0;
      var yLogo = (parseInt(styleInfo.top))?parseInt(d.top):0;

   }
   else
   {
      return;
   }

}

/******************************************************************************/
function FndObject(n, d)
{ //v4.01
   var p, i, x;

   //alert("FndObject; 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];

   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 = FndObject(n,d.layers[i].document);

   if (!x && d.getElementById)
      x = d.getElementById(n);

   return x;
}


