NS4		= (document.layers);
NS6		= ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 5));
IE4		= (document.all);
MAC45		= (navigator.appVersion.indexOf("MSIE 4.5") != -1);
ver4		= (NS4 || IE4);   
isMac		= (navigator.appVersion.indexOf("Mac") != -1);
menuHeight	= 0;
menuWidth	= 0;
menuOffset	= 258;
var overmenu	= false;
var openmenu	= null;
var overcheck	= null;

function FindLeftEdge(img)
{
	xPos = img.offsetLeft;
	tempEl = img.offsetParent;
	while (tempEl != null)
	{
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}
	return xPos;
}
function finddist(imgname1,imgname2)	// Position of Image File
{
	var image1	= document.images[imgname1];
	var image2	= document.images[imgname2];
	var posLeft1	= (NS4 && !NS6) ? image1.x : FindLeftEdge(image1);
	var posLeft2	= (NS4 && !NS6) ? image2.x : FindLeftEdge(image2);
	return posLeft2 - posLeft1;
}


// Bilder austauschen
function repl_img(name,typ)
{
	var dir = "images/";
	var ext = ".jpg";
	if (typ == "g") ext = ".gif";
	var on_img = new Image();
	on_img.src = dir + name + "_o" + ext; // .jpg";
	document[name].src = on_img.src;
}
function unrepl_img(name,typ)
{
	dir = "images/";
	var ext = ".jpg";
	if (typ == "g") ext = ".gif";
	var on_img = new Image();
	on_img.src =  dir + name + "_n" + ext; // .jpg";
	document[name].src = on_img.src;
}
// Bilder vorladen
function preload()
{
	if (!document.images)
	{
		return;
	}
	var j = -1;
	var ar = new Array();
	for (i in document.images)
	{
		if (isFinite(i))
		{ 
			j++;
			ar[j] = new Image();
			ar[j].src = document.images[i].src;
		}
	}
}

function OpenPopUp(FName,w,h)
{
	if (isNaN(w)) w = 620;
	if (isNaN(h)) h = 445;
	FNameWindow=window.open(FName, "FNameWindow", "width="+w+", height="+h+", resizeable=no, toolbar=no, status=no, scrollbars=no, menubar=no");
}
function OpenScrollPopUp(FName,w,h)
{
	if (isNaN(w)) w = 620;
	if (isNaN(h)) h = 445;
	FNameWindow=window.open(FName, "FNameWindow", "width="+w+", height="+h+", resizeable=no, toolbar=no, status=no, scrollbars=yes, menubar=no");
}

// zur Startseite machen
function home(URL)
{
	if (NS4 || NS6) alert("Netscape unterstütz diese Funktion nicht!");
	else
	{
		document.all.home.style.behavior= "url(#default#homepage)";
		document.all.home.sethomepage("http://" + URL);
	}
}
// zu Favoriten hinzufügen
function favoriten(URL,Titel) 
{ 
	if (document.all)
		window.external.AddFavorite("http://"+URL,Titel);
} 
// Seite Empfehlen
function empfehlen(FName,w,h)
{
	if (isNaN(w)) w = 620;
	if (isNaN(h)) h = 445;
	FNameWindow=window.open(FName, "FNameWindow", "width="+w+", height="+h+", resizeable=no, toolbar=no, status=no, scrollbars=no, menubar=no");
}


// Anrede für Bestätigungsformular
function CreateAnrede(form)
{
	if (form.Kontakt_Anrede.value == "Herr")
		form.Kontakt_Ansprache.value = "Sehr geehrter";
	else if (form.Kontakt_Anrede.value == "Frau")
		form.Kontakt_Ansprache.value = "Sehr geehrte";
	else
		form.Kontakt_Ansprache.value = "Sehr geehrte Frau und Herr";
	return;
}

// Mailadresse für SendMail erstellen
function CreateMailAdr(form)
{
	if (form.EmpfMail.value == "")
		alert("Bitte E-Mailadresse des Empfängers eingeben");
	else (form.EmpfMail.value != "")
		form.MailAdr.value = "mailto:"+form.EmpfMail.value;
	//	form.S-Email-Address.value = form.EmpfMail.value;
	return;
}

// E-Mail Adresse im HTML vor Spam schützen
function mail(name,domain,toplevel,style,text)
{
	if (style) style = 'class="'+style+'"';
	document.write('<a ' + style + ' href="mailto:' + name + '@' + domain + '.' + toplevel + '">');
	if (text) document.write(text + '</a>');
	else	document.write(name  + '@' + domain + '.' + toplevel + '</a>');
}
// -->