var DHTML = false, DOM = false, MSIE4 = false, NS4 = false, OP = false;

if (document.getElementById) {
  DHTML = true;
  DOM = true;
} else {
  if (document.all) {
    DHTML = true;
    MSIE4 = true;
  } else {
    if (document.layers) {
      DHTML = true;
      NS4 = true;
    }
  }
}
if (window.opera) {
  OP = true;
}

function openWindow(theURL,winName,features) { //v2.0
  if (features == '') {
  	var Bildschirm_breite = screen.width;
	var Bildschirm_hoehe = screen.height;
	var	pos_x = 0;
	var pos_y = 0;
  	var features = "left=" + pos_x + ",top=" + pos_y + ",width=" + Bildschirm_breite + ",height=" + Bildschirm_hoehe + ",location=no,menubar=no,resizable=no,status=no,toolbar=no,scrollbars=yes";
	}
  	NeuFenster = window.open(theURL,winName,features);
	window.NeuFenster.focus();
}

function openWindowMax(theURL,winName,Zeiger) { //v2.0
	var Bildschirm_breite = screen.width;
	var Bildschirm_hoehe = screen.height;
	var Ziel = document.getElementById("Bild_" + Zeiger).src;
	var Laenge = Ziel.length;
	var Start = Laenge - 36;
	var Foto_id = Ziel.substr(Start, 32);
	pos_x = 0;
	pos_y = 0;
	features = "left=" + pos_x + ",top=" + pos_y + ",width=" + Bildschirm_breite + ",height=" + Bildschirm_hoehe + ",location=no,menubar=no,resizable=no,status=no,toolbar=no,scrollbars=yes";
	NeuFenster = window.open(theURL + "?BILD=" + Foto_id,winName,features);
	window.NeuFenster.focus();
}

function Fussposition2(mehr_y)
	{
	var x,y;
	var Bildschirm_breite = screen.width;
	var Bildschirm_hoehe = screen.height;
	
	if (self.innerHeight) // all except Explorer
		{
		x = self.innerWidth;
		y = self.innerHeight;
		if (OP ) 
			{
			document.getElementById("Inhalt2").style.height = y-18-mehr_y;
			}
		else 
			{
			document.getElementById("Inhalt2").style.height = (y-19-mehr_y);
			}
		}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
		{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
		}
	else if (document.body) // other Explorers, z.B. IE 6
		{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
		document.all.Inhalt2.style.height = y- mehr_y + 30;
		}
	
}

function EingabeFenster(theURL,Breite,Hoehe)
	{
	var x,y;
	var Fenstername = "Eingabefenster" + Hoehe + Breite;
	var Bildschirm_breite = screen.width;
	var Bildschirm_hoehe = screen.height;
	
	if (self.innerHeight) // all except Explorer
		{
		x = self.innerWidth;
		y = self.innerHeight;
		}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
		{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
		}
	else if (document.body) // other Explorers
		{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
		}
	
	pos_x = (Bildschirm_breite - Breite)/2;
	pos_y = (Bildschirm_hoehe - Hoehe)/2.4;
	features = "left=" + pos_x + ",top=" + pos_y + ",width=" + Breite + ",height=" + Hoehe + ",location=no,menubar=no,resizable=yes,status=no,toolbar=no,scrollbars=yes";
	//alert(features);
	Fenster = window.open(theURL,Fenstername,features);
	Fenster.focus();
}

// --------------------------------------------------------------- //
//                     news ticker function                        //
// --------------------------------------------------------------- //
var cnt=0;			// current news item
var curr = "";
var i=-1;			// current letter being typed

function newsticker(text)
	{
	// next character of current item
	if (newslist[cnt][0] != "")//Es existiert ein aktueller Eintrag
		{
		if (i < newslist[cnt][0].length - 1)
			{
	    	i++;
			url_name = newslist[cnt][0];	
			url_name_buchstaben = url_name.split('');	
  			curr = curr+url_name_buchstaben[i];
			url_link = newslist[cnt][1];
			fenster = newslist[cnt][2];
  			document.getElementById("newstxt").innerHTML = curr;
			if (i == newslist[cnt][0].length - 1)
				{
				document.getElementById("newstxt").innerHTML = "<font color='#404040'>"+curr+" ... </font><a href='"+url_link+"' target='"+fenster+"' title='für weitere Infos hier klicken'><font color='#FF0000'>mehr</font></a>";
				}
		
			setTimeout('newsticker()',40)
			return;
			}
		}
	// new item
	i = -1; curr = "";
	if (cnt<newslist.length-1)
		cnt++;
	else
		cnt=0;
	setTimeout('newsticker()',8000)

	}
// --------------------------------------------------------------- //
//                     news ticker function ENDE                   //
// --------------------------------------------------------------- //

function Check_delete(url,Text) {
	Check = confirm("Wollen Sie "+ Text + " wirklich löschen?");
	if (Check == false) 
		{
		var x = "o";
		alert('Der Löschvorgang wurde abgebrochen!');
		}
	else
		{
		parent.location.href = url;
		//parent.frames.location.href = url;
		}
}

function Bestaetigung(url,Name) {
	Check = confirm("Wollen Sie die Buchung für "+ Name + " bestätigen und eine Info-Email versenden (Diese Aktion kann nicht rückgängig gemacht werden)?");
	if (Check == false) 
		{
		var x = "o";
		alert('Der Vorgang wurde abgebrochen!');
		}
	else
		{
		alert('Die Anmeldung wird per Email bestätigt!!');
		parent.location.href = url;
		//parent.frames.location.href = url;
		}
}

function Check_Buchung(url,Name) {
	Check = confirm("Wollen Sie die Buchung für "+ Name + " wirklich als 'Bezahlt' markieren?");
	if (Check == false) 
		{
		var x = "o";
		alert('Der Buchungsvorgang wurde abgebrochen!');
		}
	else
		{
		alert('Die Bezahlung wird bestätigt!');
		parent.location.href = url;
		//parent.frames.location.href = url;
		}
}

function ReCheck_Stornierung(url,Name) {
	Check = confirm("Wollen Sie die Anmeldung für "+ Name + " wirklich wieder aktivieren?");
	if (Check == false) 
		{
		var x = "o";
		alert('Der Anmeldung wurde abgebrochen!');
		}
	else
		{
		alert('Die Stornierung wird aufgehoben!');
		parent.location.href = url;
		//parent.frames.location.href = url;
		}
}

function Check_Stornierung(url,Name) {
	Check = confirm("Wollen Sie die Buchung für "+ Name + " wirklich stornieren?");
	if (Check == false) 
		{
		var x = "o";
		alert('Der Buchungsvorgang wurde abgebrochen!');
		}
	else
		{
		alert('Die Buchung wird storniert!');
		parent.location.href = url;
		//parent.frames.location.href = url;
		}
}

function Buchung_loeschen(url,Name) {
	Check = confirm("Wollen Sie die Buchung für "+ Name + " wirklich aus der Datenbank löschen?");
	if (Check == false) 
		{
		var x = "o";
		alert('Der Löschvorgang wurde abgebrochen!');
		}
	else
		{
		alert('Die Buchung wird gelöscht!');
		parent.location.href = url;
		//parent.frames.location.href = url;
		}
}


function Check_delete2(url,Text) {
	Check = confirm("Wollen Sie "+ Text + " wirklich löschen?");
	if (Check == false) 
		{
		var x = "o";
		alert('Der Löschvorgang wurde abgebrochen!');
		}
	else
		{
		parent.frames.location.href = url;
		}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; 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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function setTextOfLayer(objName,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function verschieben(was, startx, starty) {

	if(document.layers)
    	{ 
        document.layers[was].left=startx;
        document.layers[was].top=starty;
        }
        else
        {
        document.all[was].style.left=startx;
        document.all[was].style.top=starty;
        }
	}

function Ziel (Name,Ziel,Fenster,Titel) {
		document.getElementsByName(Name)[0].href = Ziel;
		document.getElementsByName(Name)[0].target = Fenster;
		document.getElementsByName(Name)[0].title = Titel;
}

function TitleUpdate (Name,Wert) {
		document.getElementsByName(Name)[0].title = Wert;
}

function neuAufbau () {
   	location.href = location.href;
	}


