var timer_id;   // Wichtig, da sonst beim ERSTEN Aufruf über MouseOver von kontaktdaten() kein Fenster angezeigt wird,
                // da die Variable noch nicht gesetzt wurde/bekannt ist.

//============
function Go(x)
{
	if(x == "nothing")
	{
		document.forms[0].reset();
		document.forms[0].elements[0].blur();
		return;
	}
	else
	{
		if(x.indexOf("#") == -1)
		{
			// Eventuelle Frames entfernen
			top.location.href = x;
		}
		else
		{
			top.location.href = x;
		}
		// Auswahl zurücksetzen, da sonst keine wiederholte Auswahl desselben Punktes möglich ist!
		document.forms[0].reset();
	}
}

//=====================================
function Firmenliste_Validator(theForm)
{
	return (Anschrift_Validator(theForm));
	return (true);
}

//===================================
function Anschrift_Validator(theForm)
{
	if (theForm.firma.value == "")
	{
	alert("Firmenname erforderlich.");
	theForm.firma.focus();
	return (false);
	}

	if (theForm.firma.value.length < 3)
	{
	alert("Mindestens drei Zeichen im Feld [Firma] erforderlich.");
	theForm.firma.focus();
	return (false);
	}

	if (theForm.name.value == "")
	{
	alert("Name erforderlich.");
	theForm.name.focus();
	return (false);
	}

	if (theForm.name.value.length < 3)
	{
	alert("Mindestens fünf Zeichen (incl. Anrede) im Feld [Name] erforderlich.");
	theForm.name.focus();
	return (false);
	}

	//if (theForm.telefon.value == "" && theForm.fax.value == "")

	if (theForm.telefon.value.length < 6
			|| (theForm.telefon.value.substr(0,1) != "0" && theForm.telefon.value.substr(0,1) != "+")
			|| theForm.telefon.value.substr(0,1) == theForm.telefon.value.substr(1,1)
		 )
	{
	alert("Ungültige Telefon-Nr!");
	theForm.telefon.focus();
	return (false);
	}

	if (!eMail_Validator(theForm)) return false;

	return (true);
}

//===============================
function eMail_Validator(theForm)
	{
 	return true;
	}

//================================
function S_Mail_Validator(theForm)
{
	if (theForm.subject.value == "")
	{
 	alert("Tragen Sie bitte einen Betreff in das Feld \"Betreff\" ein.");
 	theForm.subject.focus();
 	return (false);
 	}

 	if (theForm.text.value.length < 10)
 	{
 	alert("Mindestens 10 Zeichen sind im Feld [Text] erforderlich.");
 	theForm.text.focus();
 	return (false);
 	}

	if (!eMail_Validator(theForm)) return false;

	return (true);
}

//=========================
function kontaktdaten(html)
{
// Timer für letztes Fenster zurücksetzen, falls noch läuft...
window.clearTimeout(timer_id);

// Verzögerung damit Fenster nich beim zufälligen Überfahren des Mauszeigers aufgeht
timer_id = window.setTimeout('kontaktfenster('+html+')', 300);
}

//===========================
function kontaktfenster(html)
{
var breit= 450;
var hoch = 260;
var bs_breite = screen.width;
var nav = navigator.appName;

if (nav == "Netscape")
  {
  var xPos = screenX;
  var yPos = window.screenY;
  }

if (navigator.appName == "Microsoft Internet Explorer")
  {
  var xPos = (document.all)
	var yPos = (document.all)

	// Die folgenden beiden Zeilen erzeugten leider im IE eine Fehlermeldung deren Ursprung nicht zu erkennen war.
	// Stundenlanges suchen, keine Hiulfe in den Foren! Tritt nur auf in Verbindung von
	// "timer_id = window.setTimeout('kontaktfenster('+html+')', 300);" in der aufrufenden Funktion.
	//var xPos = window.event.x;
  //var yPos = window.event.y;
  }

// Fenster auf der Seite (links oder rechts der akt. Cursorposition) öffnen, auf der mehr Platz ist.
// Akt. Fensterbreite ermitteln

if (xPos < bs_breite/2)
	{
	// Rechts positionieren
	xPos += 20;
	}
else
	{
	// Links positionieren
	xPos -= (20 + breit);
	}

window.clearTimeout(timer_id);
msg1=window.open("../kontaktdaten.php?ident_nr="+html,"kontaktdaten","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width="+breit+",height="+hoch+",left="+xPos+",top=0");
}

//=======================
function msg1_close()
{
window.clearTimeout(timer_id);
timer_id=window.setTimeout("msg1.close()",30*1000);
}

//=================
function winopen2()
{
msg2=open("text2.html","FensterName2","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=200,height=250");
}

//========================
function fenster_1(cDatei)
	{
	fenster=open("123","Fenstertitel","height=350,width=250,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,left=0,top=0");
	fenster.document.write("<html><title>Windows!</title>"
	+ "<body bgcolor='blue' onblur=window.close()>"
	+ "<table height=100% width=100% border=0>"
	+ "<tr><td align=center valign=center width=100%>"
	+ "<img src=http://members.carinthia.com/fips/images/bt-fips1.gif>"
	+ "<alt='' align=center valign=center><P>"
	+ "<b><a href='javascript:window.close()'>Dieses Fenster ist:<br>"
	+ "0 Pixel von Links<br>0 Pixel von "
	+ "oben</a>.</b></td></tr>"
	+ "</table></body></html><p>");
}

//========================================
function fenster_2(url,breite,hoehe,titel)
{
  var options="left=0,top=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,height="+hoehe+",width="+breite;
  fenster_2=window.open(url,titel,options);
}

//=======================
function version(abfrage)

{
// Netscape oder Microsoft - das ist hier die Frage
var NS  = navigator.appName == "Netscape";
var IE  = navigator.appName == "Microsoft Internet Explorer" ||
          navigator.appName == "";

// Mindestens Version 4
var BB4 = navigator.appVersion.substring(0,1) >= "4";
var NS4 = BB4 && NS;
var IE4 = BB4 && IE;

// Maximal Version 3
var BB3 = navigator.appVersion.substring(0,1) <= "3";
var NS3 = BB3 && NS;
var IE3 = BB3 && IE;
}


//***************
function timer(n)

{	// Zeitschleife in Millisekunden
  date = new Date();
	timestamp = date.getTime();
	diff = 0;

	while (diff < n)
	{
	date = new Date();
	diff = date.getTime() - timestamp;
	}
}


//*********************
function PopupFenster()
{
	F = window.open("../etiketten/stichwortliste.htm","Popup","width=360,height=400,left=460,top=90,scrollbars=yes,toolbar=no");
	F.focus();
}


//***********************
function Link_des_Tages()
{
var msg = new Array();
Stamp = new Date();
today = Stamp.getDate();

msg[1]  = '<a href="/s_stellenangebote.htm">Stellenangebote</a>';
msg[2]  = '<a href="/s_newsletter.htm">Newsletter</a>';
msg[3]  = '<a href="/v_mailingliste.htm">Mailingliste</a>';
//...
msg[29]  = '<a href="/s_newsletter.htm">Newsletter</a>';
msg[30]  = '<a href="/v_mailingliste.htm">Mailingliste</a>';
msg[31]  = '<a href="/s_stellenangebote.htm">Stellenangebote</a>';

document.write(msg[today]);
}
