// Browserabfragen

var macie = false;
if (navigator.userAgent.indexOf("Mac") != -1 && navigator.userAgent.indexOf("MSIE") != -1) macie = true;

var nn6 = false;
if (navigator.userAgent.indexOf("Netscape6") != -1) nn6 = true;

var mozilla = false;
if (navigator.userAgent.indexOf("Mozilla") != -1 && navigator.appVersion.substring(0,1) >= 5) mozilla = true;


// blindGif preloaden
blindGif = new Image; blindGif.src = "_gfx/1px.gif";


// Button-Preload

bt_profil_pas = new Image; bt_profil_pas.src = "_gfx/bt_profil_p.gif";
bt_profil_ovr = new Image; bt_profil_ovr.src = "_gfx/bt_profil_o.gif";

bt_terminvereinbarung_pas = new Image; bt_terminvereinbarung_pas.src = "_gfx/bt_terminvereinbarung_p.gif";
bt_terminvereinbarung_ovr = new Image; bt_terminvereinbarung_ovr.src = "_gfx/bt_terminvereinbarung_o.gif";

bt_links_pas = new Image; bt_links_pas.src = "_gfx/bt_links_p.gif";
bt_links_ovr = new Image; bt_links_ovr.src = "_gfx/bt_links_o.gif";

bt_aktuelles_pas = new Image; bt_aktuelles_pas.src = "_gfx/bt_aktuelles_p.gif";
bt_aktuelles_ovr = new Image; bt_aktuelles_ovr.src = "_gfx/bt_aktuelles_o.gif";

bt_kontakt_pas = new Image; bt_kontakt_pas.src = "_gfx/bt_kontakt_p.gif";
bt_kontakt_ovr = new Image; bt_kontakt_ovr.src = "_gfx/bt_kontakt_o.gif";

bt_wasist_pas = new Image; bt_wasist_pas.src = "_gfx/bt_wasist_p.gif";
bt_wasist_ovr = new Image; bt_wasist_ovr.src = "_gfx/bt_wasist_o.gif";

bt_wasbietet_pas = new Image; bt_wasbietet_pas.src = "_gfx/bt_wasbietet_p.gif";
bt_wasbietet_ovr = new Image; bt_wasbietet_ovr.src = "_gfx/bt_wasbietet_o.gif";

bt_waskoennen_pas = new Image; bt_waskoennen_pas.src = "_gfx/bt_waskoennen_p.gif";
bt_waskoennen_ovr = new Image; bt_waskoennen_ovr.src = "_gfx/bt_waskoennen_o.gif";

bt_warumueberhaupt_pas = new Image; bt_warumueberhaupt_pas.src = "_gfx/bt_warumueberhaupt_p.gif";
bt_warumueberhaupt_ovr = new Image; bt_warumueberhaupt_ovr.src = "_gfx/bt_warumueberhaupt_o.gif";

bt_welcheangebote_pas = new Image; bt_welcheangebote_pas.src = "_gfx/bt_welcheangebote_p.gif";
bt_welcheangebote_ovr = new Image; bt_welcheangebote_ovr.src = "_gfx/bt_welcheangebote_o.gif";

bt_waskostet_pas = new Image; bt_waskostet_pas.src = "_gfx/bt_waskostet_p.gif";
bt_waskostet_ovr = new Image; bt_waskostet_ovr.src = "_gfx/bt_waskostet_o.gif";

bt_erfahrungsberichte_pas = new Image; bt_erfahrungsberichte_pas.src = "_gfx/bt_erfahrungsberichte_p.gif";
bt_erfahrungsberichte_ovr = new Image; bt_erfahrungsberichte_ovr.src = "_gfx/bt_erfahrungsberichte_o.gif";

bt_bundh_pas = new Image; bt_bundh_pas.src = "_gfx/bt_bundh_p.gif";
bt_bundh_ovr = new Image; bt_bundh_ovr.src = "_gfx/bt_bundh_o.gif";

bt_impressum_pas = new Image; bt_impressum_pas.src = "_gfx/bt_impressum_p.gif";
bt_impressum_ovr = new Image; bt_impressum_ovr.src = "_gfx/bt_impressum_o.gif";

bt_kooperation_pas = new Image; bt_kooperation_pas.src = "_gfx/bt_kooperation_p.gif";
bt_kooperation_ovr = new Image; bt_kooperation_ovr.src = "_gfx/bt_kooperation_o.gif";

bt_stephanus_pas = new Image; bt_stephanus_pas.src = "_gfx/bt_stephanus_p.gif";
bt_stephanus_ovr = new Image; bt_stephanus_ovr.src = "_gfx/bt_stephanus_o.gif";

bt_pfeilv_pas = new Image; bt_pfeilv_pas.src = "_gfx/bt_pfeilv_p.gif";
bt_pfeilv_ovr = new Image; bt_pfeilv_ovr.src = "_gfx/bt_pfeilv_o.gif";

bt_pfeilr_pas = new Image; bt_pfeilr_pas.src = "_gfx/bt_pfeilr_p.gif";
bt_pfeilr_ovr = new Image; bt_pfeilr_ovr.src = "_gfx/bt_pfeilr_o.gif";


// Funktionen zum Umschalten der Buttons

function ovr(imgName) {
		if (document.all || nn6 == true) {
			document.all[imgName].src = eval(imgName + "_ovr.src");
		} else {
			document.images[imgName].src = eval(imgName + "_ovr.src");
		}
}

function pas(imgName) {
		if (document.all || nn6 == true) {
			document.all[imgName].src = eval(imgName + "_pas.src");
		} else {
			document.images[imgName].src = eval(imgName + "_pas.src");
		}
}




// Statusanzeige

window.defaultStatus = "Bärend";

function statustext(text) {
	window.status = "Bärend Lebensberatung - " + text;
}


// Funktion fuer die Input-Felder und das Texteingabefeld

function inputField(name,value,optional,opttxt,title,laenge,nnlaenge,maxlaenge)
	{
		if (optional==2)  optMeldung = ' onfocus="if (document.formular.'+name+'.value==\''+opttxt+'\') {document.formular.'+name+'.value=\'\'}" onblur="if (document.formular.'+name+'.value==\'\') {document.formular.'+name+'.value=\''+opttxt+'\'}"';
		if (optional==1)  optMeldung = ' onfocus="if (document.formular.'+name+'.value==\'(optional)\') {document.formular.'+name+'.value=\'\'}" onblur="if (document.formular.'+name+'.value==\'\') {document.formular.'+name+'.value=\'(optional)\'}"';
		if (optional==0)  optMeldung = '';

		if (macie == true) { document.write ('<input type="text" size="'+(laenge-10)+'" maxlength="'+maxlaenge+'" name="'+name+'" value="'+value+'"'+optMeldung+' title="'+title+'">') }
		else {	if (nn6 == true) { document.write ('<input type="text" size="'+(nnlaenge-2)+'" maxlength="'+maxlaenge+'" name="'+name+'" value="'+value+'"'+optMeldung+' title="'+title+'">') }
				else { if (mozilla) { document.write ('<input type="text" size="'+laenge+'" maxlength="'+maxlaenge+'" name="'+name+'" value="'+value+'"'+optMeldung+' title="'+title+'">') }
						else { if (document.all) { document.write ('<input type="text" size="'+laenge+'" maxlength="'+maxlaenge+'" name="'+name+'" value="'+value+'"'+optMeldung+' title="'+title+'">') }
							   else { document.write ('<input type="text" size="'+nnlaenge+'" maxlength="'+maxlaenge+'" name="'+name+'" value="'+value+'"'+optMeldung+'>') } } } }
	}

function textArea()
	{
		if (macie == true) { document.write ('<textarea cols="26" rows="10" wrap="physical" name="anfrage">') }
		else {	if (mozilla) { document.write ('<textarea cols="36" rows="10" wrap="physical" name="anfrage">') }
				else {	if (document.all) { document.write ('<textarea cols="36" rows="10" wrap="physical" name="anfrage">') }
						else { document.write ('<textarea cols="19" rows="10" wrap="physical" name="anfrage">') } } }
	}
