// globale Vorbelegung der Parameter
var StyleFont;
var StyleColorGrey;
var StyleColor;
var Catchword;
var Name;
var Town;
var Street;
var Phone;

var _Settings = {
        StyleFont: 'bold 12px tahoma',
        StyleColorGrey: '#999',
        StyleColor: '#000',
        Catchword: 'z.B. Hotel',
        Name: 'z.B. Schmidt',
        Town: 'z.B. Berlin',
        Street: 'z.B. Torstr.',
        Phone: 'z.B. 0721 9638600'
    };

var GetDefaultValues = function()
{
    return _Settings;
};

var SetDefaultValue = function(Name,Value)
{
    switch (Name)
    {
        case "StyleFont":            
            this._Settings.StyleFont = Value;
            break;
        case "StyleColorGrey":            
            this._Settings.StyleColorGrey = Value;
            break;
        case "StyleColor":            
            this._Settings.StyleColor = Value;
            break;
        case "Catchword":
            this._Settings.Catchword = Value;
            break;
        case "Name":            
            this._Settings.Name = Value;
            break;
        case "Town":            
            this._Settings.Town = Value;
            break;
        case "Street":            
            this._Settings.Street = Value;
            break;
        case "Phone":            
            this._Settings.Phone = Value;
            break;
    }
};

// Speichert die ID des aktiven Reiters. Standardmäßig auf LATab1
var SelectedTabID = "LATab1";

function GetTabElements()
{
	var TabElements = null;
	// Alle Reiter ermitteln
	if (document.getElementById('LATabNavigation') != null)
	{
		TabElements = document.getElementById('LATabNavigation').getElementsByTagName('li')
	}
	return TabElements;
}

// Beim Erstaufruf anhand des Reiters das passende Suchformular einblenden
function LoadHeaderForm()
{
	CloseFrm();
	
	TabElements = GetTabElements();
	
	if (TabElements != null)
	{
		// Selektierten Reiter feststellen
		for (var i = 0; i < TabElements.length; i++)
		{
			if (TabElements[i].className == 'SelectedTab')
			{
				SelectedTabID = TabElements[i].id;
			}
		}
	}

	switch (SelectedTabID)
	{
		case "LATab0":
			CloseFrm();
			document.getElementById('HeaderContentDelimiter').style.borderTopColor = '#fff';
			break;
		case "LATab1":
			GetFormular('BranchSearch');
		case "LATab2":
			GetFormular('WhitePageSearch');
		case "LATab3":
			GetFormular('CityGuideSearch');
		default:
			document.getElementById('BranchSearch').style.display = 'block';
			break;
	}
}

// Suchformular im Header austauschen
function ChangeFrm(Object)
{
	CloseFrm();

	TabElements = GetTabElements();

	// Nach Klick erstmal jeden Reiter "inaktiv" kennzeichnen.
	for (var i = 0; i < TabElements.length; i++)
	{
		TabElements[i].className = '';
		TabElements[i].style.backgroundColor = '';
	}
	// Den angeklickten Reiter wieder "aktiv" kennzeichnen.
	Object.parentNode.parentNode.className = 'SelectedTab';
	// Die ID des gewählten Reiters speichern.
	SelectedTabID = Object.parentNode.parentNode.id;

	switch (SelectedTabID)
		{
		case "LATab0":
			GetFormular('CityInfoSearch');
			FillInputFields();
			break;
		case "LATab1":
			GetFormular('BranchSearch');
			FillInputFields();
			break;
		case "LATab2":
			GetFormular('WhitePageSearch');
			FillInputFields();
			break;
		case "LATab3":
			GetFormular('CityGuideSearch');
			FillInputFields();
			break;
		case "LATab4":
			GetFormular('FastSearch');
			FillInputFields();
			break;
		default:
			break;
		}
}

// Servicetext austauschen
function ChangeHeader(Object)
{
  // Die ID des gewählten Reiters speichern.
  SelectedTabID = Object.parentNode.parentNode.id;

  switch (SelectedTabID)
    {
    case "LATab0":
    // Stadtführer
            document.getElementById('LAHeadlineContent').innerHTML = "<strong>Stadtinformationen von &uuml;ber 15.000 St&auml;dten aus Deutschland...</strong><br />" +
            "...finden Sie hier. Die lokaleauskunft bietet unglaubliches: Stadtpl&auml;ne, Nachrichten, Wetter, Verkehrsinformationen, Shoppingm&ouml;glichkeiten uvm. Erleben Sie selbst. <br/>Der Clou: Regionale Partner sorgen f&uuml;r die besten Inhalte.";
            if (document.getElementById('CatalogLeftCol')) {
				document.getElementById('CatalogLeftCol').style.display = "none";
            }
            if (document.getElementById('CatalogRightCol')) {
				document.getElementById('CatalogRightCol').style.display = "none";
            }
            if (document.getElementById('BRDMAP')) {
				document.getElementById('BRDMAP').style.display = "block";
            }
            break;
    case "LATab1":
    // Branchenbuch
            document.getElementById('LAHeadlineContent').innerHTML = "<strong>Im umfangreichen Branchenbuch von lokaleauskunft.de...</strong><br />" +
            "...finden Sie &uuml;ber 4,5 Mio. Adressen aus &uuml;ber 7000 Branchen mit insgesamt 30 Millionen Zuordnungen. Bitte w&auml;hlen Sie eine Branche oder geben Sie einfach eine Branche oder einen Firmennamen ein. Der Clou: die Adressen stammen aus &uuml;ber 50 Premiumquellen.";            
            if (document.getElementById('CatalogLeftCol')) {
				document.getElementById('CatalogLeftCol').style.display = "block";
            }
            if (document.getElementById('CatalogRightCol')) {
				document.getElementById('CatalogRightCol').style.display = "block";
            }
            break;
    case "LATab2":
    // Telefonbuch
            document.getElementById('LAHeadlineContent').innerHTML = "<strong>Im umfangreichen Telefonbuch von lokaleauskunft.de...</strong><br />" +
            "...finden Sie tagesaktuell &uuml;ber 32 Millionen Telefonteilnehmer aus Deutschland.<br /> " +
            "Die Daten basieren auf dem Teilnehmerverzeichnis der Deutschen Telekom " +
            "und umfassen auch die ver&uuml;ffentlichungswilligen Teilnehmer alternativer Netzbetreiber inkl. der Mobilfunkprovider. " +
            "Der Clou: Im Telefonbuch der LokalenAuskunft k&ouml;nnen Sie im Umkreis suchen: z.B. Helmut Schmidt in Hamburg.";
            if (document.getElementById('CatalogLeftCol')) {
				document.getElementById('CatalogLeftCol').style.display = "none";
            }
            if (document.getElementById('CatalogRightCol')) {
				document.getElementById('CatalogRightCol').style.display = "none";
            }
            if (document.getElementById('BRDMAP')) {
				document.getElementById('BRDMAP').style.display = "none";
            }
            break;
    case "LATab3":
    // Stadtplan
            document.getElementById('LAHeadlineContent').innerHTML = "<strong>Stadtpl&auml;ne von &uuml;ber 15.000 St&auml;dten aus Deutschland...</strong><br />" +
            "...finden Sie hier. Umfeldinformationen und vieles mehr bieten ein neues Stadtplanerlebnis. <br />Der Clou: Blenden Sie umfangreiche Branchenadressen direkt in die Karte ein!";
            if (document.getElementById('CatalogLeftCol')) {
				document.getElementById('CatalogLeftCol').style.display = "none";
            }
            if (document.getElementById('CatalogRightCol')) {
				document.getElementById('CatalogRightCol').style.display = "none";
            }
            if (document.getElementById('BRDMAP')) {
				document.getElementById('BRDMAP').style.display = "none";
            }
            break;
    case "LATab4":
    // Schnellsuche
            document.getElementById('LAHeadlineContent').innerHTML = "<strong>Willkommen in den Geheimnissen Ihrer lokalen Welt!</strong><br />" +
            "Die lokaleauskunft bietet Ihnen &uuml;ber 4,5 Millionen Branchenadressen, 32 Millionen Telefonteilnehmer und Stadtinformationen von allen 12.244 St&auml;dten in Deutschland. Entdecken Sie Ihre Stadt oder Ihr Reiseziel mit einem Klick in die Karte.";
            break;
    default:
            break;
    }
}

// Auf das entsprechende Formular umschalten
function ChangeFrmOptionalFields(NodeId)
{
	//CloseFrm();
   
	switch (NodeId)
	{
		case "BranchSearch":
			//GetFormular('BranchSearch');
            SetDefaultValue("Catchword",document.getElementById('CatchwordCircumCircle').value);
            SetDefaultValue("Town",document.getElementById('ZipTownCircumCircle').value);
			document.getElementById('BranchSearchCircumCircle').style.display = 'none';
			document.getElementById('BranchSearch').style.display = 'block';
			document.getElementById('BranchSearchCatchword').value = GetDefaultValues().Catchword;
			document.getElementById('BranchSearchZipTown').value = GetDefaultValues().Town;
			break;
		case "BranchSearchCircumCircle":
			// GetFormular('BranchSearchCircumCircle');
            SetDefaultValue("Catchword",document.getElementById('BranchSearchCatchword').value);
            SetDefaultValue("Town",document.getElementById('BranchSearchZipTown').value);
			document.getElementById('BranchSearch').style.display = 'none';
			document.getElementById('BranchSearchCircumCircle').style.display = 'block';
			document.getElementById('CatchwordCircumCircle').value = GetDefaultValues().Catchword;
			document.getElementById('ZipTownCircumCircle').value = GetDefaultValues().Town;
			break;
		case "BranchSearchReversSearch":
			GetFormular('BranchSearchReversSearch');
			break;
		case "WhitePageSearch":
			//GetFormular('WhitePageSearch');
            SetDefaultValue("Name",document.getElementById('WhitePageSearchCatchwordCircumCircle').value);
            SetDefaultValue("Town",document.getElementById('WhitePageSearchZipTownCircumCircle').value);
			document.getElementById('WhitePageSearchCircumCircle').style.display = 'none';
			document.getElementById('WhitePageSearchReversSearch').style.display = 'none';
			document.getElementById('WhitePageSearch').style.display = 'block';
			document.getElementById('WhitePageSearchCatchword').value = GetDefaultValues().Name;
			document.getElementById('WhitePageSearchZipTown').value = GetDefaultValues().Town;
			break;
		case "WhitePageSearchReversSearch":
			//GetFormular('WhitePageSearchReversSearch');
			document.getElementById('WhitePageSearch').style.display = 'none';
			document.getElementById('WhitePageSearchCircumCircle').style.display = 'none';
			document.getElementById('WhitePageSearchReversSearch').style.display = 'block';
			break;
		case "WhitePageSearchCircumCircle":
			//GetFormular('WhitePageSearchCircumCircle');
            SetDefaultValue("Name",document.getElementById('WhitePageSearchCatchword').value);
            SetDefaultValue("Town",document.getElementById('WhitePageSearchZipTown').value);
			document.getElementById('WhitePageSearch').style.display = 'none';
			document.getElementById('WhitePageSearchReversSearch').style.display = 'none';
			document.getElementById('WhitePageSearchCircumCircle').style.display = 'block';
			document.getElementById('WhitePageSearchCatchwordCircumCircle').value = GetDefaultValues().Name;
			document.getElementById('WhitePageSearchZipTownCircumCircle').value = GetDefaultValues().Town;
			break;
		case "WhitePageSearchExtended":
			GetFormular('WhitePageSearchExtended');
			break;
		case "CityGuideSearch":
			GetFormular('CityGuideSearch');
			break;
		case "CityInfoSearch":
			GetFormular('CityInfoSearch');
			break;
		case "FastSearch":
			GetFormular('FastSearch');
			break;
	}
}

// Alle Formulare schliessen
function CloseFrm()
{
	if (document.getElementById('BranchSearch') != null)
		document.getElementById('BranchSearch').style.display = 'none';
	if (document.getElementById('BranchSearchReversSearch') != null)
		document.getElementById('BranchSearchReversSearch').style.display = 'none';
	if (document.getElementById('BranchSearchCircumCircle') != null)
		document.getElementById('BranchSearchCircumCircle').style.display = 'none';
	if (document.getElementById('WhitePageSearch') != null)
		document.getElementById('WhitePageSearch').style.display = 'none';
	if (document.getElementById('WhitePageSearchReversSearch') != null)
		document.getElementById('WhitePageSearchReversSearch').style.display = 'none';
	if (document.getElementById('WhitePageSearchCircumCircle') != null)
		document.getElementById('WhitePageSearchCircumCircle').style.display = 'none';
	if (document.getElementById('WhitePageSearchExtended') != null)
		document.getElementById('WhitePageSearchExtended').style.display = 'none';
	if (document.getElementById('CityGuideSearch') != null)
		document.getElementById('CityGuideSearch').style.display = 'none';
	if (document.getElementById('CityInfoSearch') != null)
		document.getElementById('CityInfoSearch').style.display = 'none';
}

var Formular = "";

function GetFormular(ElementID)
{
	switch(ElementID)
	{
		case "BranchSearch":
			Formular = "<div id=\"BranchSearch\"><form action=\"Search.aspx\" method=\"post\">" +
			"<input type=\"hidden\" name=\"Service\" value=\"Branchenbuch\"/>" +
			"<table border=\"0\" width=\"536\">" +
			"<tr><td colspan=\"6\"><ul style=\"display: inline;\"><li>" +
			"<a name=\"CircumCircleSearch\" href=\"Branchenbuch.aspx?OptionFormularFields=CircumCircleSearch\" " +
			"onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('BranchSearchCircumCircle');\">Umkreissuche ein<\/a>" +
			"&nbsp;|&nbsp;<\/li><li><a name=\"BranchCatalog\" href=\"Branchenbuch.aspx?View=5&ZipTown=" + ZipTown + "&Town=" + Town + "&CatalogID=Main&Partner=LokaleAuskunft&SecurityID=EpTHbto3lovMxMRqAX5DVw==\">Branchenkatalog<\/a>" +
			"<\/li><\/ul><\/td><\/tr>" +
			"<tr><td class=\"FrmLabel\">Was:<\/td><td>" +
			"<input type=\"text\" id=\"BranchSearchCatchword\" name=\"Catchword\" onblur=\"KeepInputFields(this);\" onfocus=\"CheckInputFields(this);\" value=\"" + Catchword + "\"\/></td><td class=\"FrmLabel\">Plz/Ort:<\/td>" +
			"<td><input type=\"text\" id=\"BranchSearchZipTown\" name=\"ZipTown\" onblur=\"KeepInputFields(this);\" onfocus=\"CheckInputFields(this);\" value=\"" + ZipTown + "\"\/></td><td class=\"FrmLabel\"></td><td><button type=\"submit\">Suchen<\/button>" +
			"</td></tr>" +
			"<\/table><\/form><\/div>";
			break;
		case "BranchSearchCircumCircle":
			Formular = "<div id=\"BranchSearchCircumCircle\">" +
			"<form action=\"Search.aspx\" method=\"post\">" +
			"<input type=\"hidden\" name=\"Service\" value=\"Branchenbuch\"/>" +
			"<table border=\"0\" width=\"536\">" +
			"<tr><td colspan=\"6\"><ul><li><a name=\"CircumCircleSearch\" href=\"Branchenbuch.aspx?OptionFormularFields=CircumCircleSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('BranchSearch');\">Umkreissuche aus</a>&nbsp;|&nbsp;</li><li><a name=\"BranchCatalog\" href=\"Branchenbuch.aspx?View=5&ZipTown=" + ZipTown + "&CatalogID=Main&Partner=LokaleAuskunft&SecurityID=EpTHbto3lovMxMRqAX5DVw==\">Branchenkatalog</a></li></ul></td></tr>" +
			"<tr>" +
				"<td class=\"FrmLabel\">Was:</td>" +
				"<td><input type=\"text\" name=\"Catchword\" value=\"" + Catchword + "\"/></td>" +
				"<td class=\"FrmLabel\">Plz/Ort:</td>" +
				"<td><input type=\"text\" name=\"ZipTown\" value=\"" + ZipTown + "\"/>" +
				"<td class=\"FrmLabel\"></td>" +
				"<td><button type=\"submit\">Suchen</button></td>" +
			"</tr>" +
			"<tr>" +
				"<td class=\"FrmLabel\">Stra&szlig;e:</td>" +
				"<td><input type=\"text\" name=\"Street\" value=\"\"/></td>" +
				"<td class=\"FrmLabel\">Umkreis:</td>" +
				"<td colspan=\"3\"><select name=\"Radius\"><option value=\"1000\">1 km</option><option value=\"5000\" selected=\"selected\">5 km</option><option value=\"10000\">10 km</option><option value=\"20000\">20 km</option><option value=\"50000\">50 km</option><option value=\"-1\">unbegrenzt</option></select></td>" +
			"</tr>" +
			"</table></form></div>";
			break;
		case "WhitePageSearch":
			Formular = "<div id=\"WhitePageSearch\">" +
			"<form action=\"Search.aspx\" method=\"post\">" +
			"<input type=\"hidden\" name=\"Service\" value=\"WhitePages\"/>" +
			"<table border=\"0\" width=\"536\">" +
			"<tr><td colspan=\"6\"><ul><li><a name=\"CircumCircleSearch\" href=\"Telefonbuch.aspx?OptionFormularFields=CircumCircleSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('WhitePageSearchCircumCircle');\">Umkreissuche ein</a>&nbsp;|&nbsp;</li><li><a name=\"ReversSearch\" href=\"Branchenbuch.aspx?OptionFormularFields=ReversSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('WhitePageSearchReversSearch');\">R&uuml;ckw&auml;rtssuche ein</a></li><!--li>&nbsp;|&nbsp;<a name=\"OptionalSearch\" href=\"Telefonbuch.aspx?OptionFormularFields=OptionalSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('WhitePageSearchExtended');\">Erweiterte Suche ein</a></li--></ul></td></tr>" +
			"<tr>" + 
				"<td class=\"FrmLabel\">Wen:</td>" +
				"<td><input type=\"text\" id=\"WhitePageSearchCatchword\" name=\"Catchword\" onblur=\"KeepInputFields(this);\" onfocus=\"CheckInputFields(this);\" value=\"" + Catchword + "\"/></td>" + 
				"<td class=\"FrmLabel\">Plz/Ort:</td>" +
				"<td><input type=\"text\" id=\"WhitePageSearchZipTown\" name=\"ZipTown\" onblur=\"KeepInputFields(this);\" onfocus=\"CheckInputFields(this);\" value=\"" + ZipTown + "\"/></td>" +
				"<td class=\"FrmLabel\"></td>" +
				"<td><button type=\"submit\">Suchen</button></td></tr>" + 
			"</table></form></div>";
			break;
		case "WhitePageSearchReversSearch":
			Formular = "<div id=\"WhitePageSearchReversSearch\">" +
			"<form action=\"Search.aspx\" method=\"post\">" +
			"<input type=\"hidden\" name=\"Service\" value=\"WhitePages\"/>" +
			"<input type=\"hidden\" name=\"QT\" value=\"20\"/>" +
			"<table border=\"0\" width=\"536\">" +
			"<tr><td colspan=\"4\"><ul><li><a name=\"CircumCircleSearch\" href=\"Telefonbuch.aspx?OptionFormularFields=CircumCircleSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('WhitePageSearchCircumCircle');\">Umkreissuche ein</a>&nbsp;|&nbsp;</li><li><a name=\"ReversSearch\" href=\"Branchenbuch.aspx?OptionFormularFields=ReversSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('WhitePageSearch');\">Standardsuche</a></li><!--li>&nbsp;|&nbsp;<a name=\"OptionalSearch\" href=\"Telefonbuch.aspx?OptionFormularFields=OptionalSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('WhitePageSearchExtended');\">Erweiterte Suche ein</a></li--></ul></td></tr>" +
			"<tr>" +
				"<td class=\"FrmLabel\">Telefonnummer:</td>" +
				"<td><input type=\"text\" name=\"PhoneNumber\" value=\"\"/></td>" +
				"<td class=\"FrmLabel\"></td>" +
				"<td><button type=\"submit\">Suchen</button></td>" +
			"</tr>" +
			"</table></form></div>";
			break;
		case "WhitePageSearchCircumCircle":
			Formular = "<div id=\"WhitePageSearchCircumCircle\">" +
			"<form action=\"Search.aspx\" method=\"post\">" +
			"<input type=\"hidden\" name=\"Service\" value=\"WhitePages\"/>" +
			"<input type=\"hidden\" name=\"QT\" value=\"19\"/>" +
			"<table border=\"0\" width=\"536\">" +
			"<tr><td colspan=\"6\"><ul><li><a name=\"CircumCircleSearch\" href=\"Telefonbuch.aspx?OptionFormularFields=CircumCircleSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('WhitePageSearch');\">Umkreissuche aus</a>&nbsp;|&nbsp;</li><li><a name=\"ReversSearch\" href=\"Branchenbuch.aspx?OptionFormularFields=ReversSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('WhitePageSearchReversSearch');\">R&uuml;ckw&auml;rtssuche ein</a></li><!--li>&nbsp;|&nbsp;<a name=\"OptionalSearch\" href=\"Telefonbuch.aspx?OptionFormularFields=OptionalSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('WhitePageSearchExtended');\">Erweiterte Suche ein</a></li--></ul></td></tr>" +
			"<tr>" +
				"<td class=\"FrmLabel\">Wen:</td>" +
				"<td><input type=\"text\" name=\"Catchword\" value=\"" + Catchword + "\"/></td>" +
				"<td class=\"FrmLabel\">Plz/Ort:</td>" +
				"<td><input type=\"text\" name=\"ZipTown\" value=\"" + ZipTown + "\"/></td>" +
				"<td class=\"FrmLabel\"></td>" +
				"<td><button type=\"submit\">Suchen</button></td>" +
			"</tr>" +
			"<tr><td class=\"FrmLabel\">Stra&szlig;e:</td><td><input type=\"text\" name=\"Street\" value=\"\"/></td><td class=\"FrmLabel\">Umkreis:</td><td><select name=\"Radius\"><option value=\"1000\">1 km</option><option value=\"5000\" selected=\"selected\">5 km</option><option value=\"10000\">10 km</option><option value=\"20000\">20 km</option><option value=\"50000\">50 km</option><option value=\"-1\">unbegrenzt</option></select></td></tr>" +
			"</table></form></div>";
			break;
		case "WhitePageSearchExtended":
			Formular = "<div id=\"WhitePageSearchExtended\">" +
			"<form action=\"Search.aspx\" method=\"post\">" +
			"<input type=\"hidden\" name=\"Service\" value=\"WhitePages\"/>" +
			"<table border=\"0\" width=\"536\">" +
			"<tr><td colspan=\"6\"><ul><li><a name=\"CircumCircleSearch\" href=\"Telefonbuch.aspx?OptionFormularFields=CircumCircleSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('WhitePageSearchCircumCircle');\">Umkreissuche ein</a>&nbsp;|&nbsp;</li><li><a name=\"ReversSearch\" href=\"Branchenbuch.aspx?OptionFormularFields=ReversSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('WhitePageSearchReversSearch');\">R&uuml;ckw&auml;rtssuche ein</a>&nbsp;|&nbsp;</li><li><a name=\"OptionalSearch\" href=\"Telefonbuch.aspx?OptionFormularFields=OptionalSearch\" onclick=\"return false;\" onmousedown=\"ChangeFrmOptionalFields('WhitePageSearch');\">Erweiterte Suche aus</a></li></ul></td></tr>" +
			"<tr><td class=\"FrmLabel\">Wen:</td><td><input type=\"text\" name=\"Catchword\" value=\"" + Catchword + "\"/></td><td class=\"FrmLabel\">Stra&szlig;e:</td><td><input type=\"text\" name=\"Street\" value=\"\"/>&nbsp;<button type=\"submit\">Suchen</button></td></tr>" +
			"<tr><td class=\"FrmLabel\">Plz:</td><td><input type=\"text\" name=\"Zip\" value=\"\"/></td><td class=\"FrmLabel\">Ort:</td><td><input type=\"text\" name=\"Town\" value=\"\"/></td></tr>" +
			"<tr><td class=\"FrmLabel\">Vorname(n):</td><td><input type=\"text\" name=\"OptionalCatchwords\" value=\"\"/></td><td class=\"FrmLabel\">Vorwahl:</td><td><input type=\"text\" name=\"Prefix\" value=\"\"/></td></tr>" +
			"</table></form></div>";
			break;
		case "CityGuideSearch":
			Formular = "<div id=\"CityGuideSearch\">" +
			"<form action=\"Search.aspx\" method=\"post\">" +
			"<input type=\"hidden\" name=\"Service\" value=\"Stadtplan\"/>" +
			"<table border=\"0\" width=\"536\">" +
			"<tr><td>&nbsp;</td></tr>" +
			"<tr><td class=\"FrmLabel\">Wo:</td><td><input type=\"text\" id=\"CityGuideSearchZipTown\" onblur=\"KeepInputFields(this);\" onfocus=\"CheckInputFields(this);\" name=\"ZipTown\" value=\"" + ZipTown + "\"/></td><td class=\"FrmLabel\">Stra&szlig;e:</td><td><input type=\"text\" id=\"CityGuideSearchStreet\" name=\"Street\" onblur=\"KeepInputFields(this);\" onfocus=\"CheckInputFields(this);\" value=\"\"/></td><td class=\"FrmLabel\"></td><td><button type=\"submit\">Suchen</button></td></tr>" +
			"</table></form></div>";
			break;
		case "CityInfoSearch":
			Formular = "<div id=\"CityGuideSearch\">" +
			"<form action=\"Search.aspx\" method=\"post\">" +
			"<input type=\"hidden\" name=\"Service\" value=\"CityGuide\"/>" +
			"<table  border=\"0\">" +
			"<tr><td>&nbsp;</td></tr>" +
			"<tr><td class=\"FrmLabel\">Wo:</td><td><input type=\"text\" id=\"CityInfoSearchZipTown\" name=\"ZipTown\" onblur=\"KeepInputFields(this);\" onfocus=\"CheckInputFields(this);\" value=\"" + ZipTown + "\"/></td><td class=\"FrmLabel\"></td><td><button type=\"submit\">Suchen</button></td></tr>" +
			"</table></form></div>";
			break;
		case "FastSearch":
			Formular = "<div id=\"FastSearch\">" +
			"<form action=\"Search.aspx\" method=\"post\">" +
			"<input type=\"hidden\" name=\"Service\" value=\"Branchenbuch\"/>" +
			"<table border=\"0\" width=\"536\">" +
			"<tr><td>&nbsp;</td></tr>" +
			"<tr>" +
			"<td class=\"FrmLabel\">Was:</td>" +
			"<td><input type=\"text\" id=\"FastSearchCatchword\" name=\"Catchword\" onblur=\"KeepInputFields(this);\" onfocus=\"CheckInputFields(this);\" value=\"" + Catchword + "\"/></td>" +
			"<td class=\"FrmLabel\"></td>" +
			"<td class=\"FrmLabel\">Plz/Ort:</td>" +
			"<td><input type=\"text\" id=\"FastSearchZipTown\" name=\"ZipTown\" onblur=\"KeepInputFields(this);\" onfocus=\"CheckInputFields(this);\" value=\"" + ZipTown + "\"/></td>" +
			"<td class=\"FrmLabel\"></td>" +
			"<td><button type=\"submit\">Suchen</button></td></tr>" +
			"</table></form></div>";
			break;
		default:
			break;
	}
	document.getElementById("Formular").innerHTML = Formular;
}

// EingabeFelder vorbelegen
function FillInputFields()
{
	// FastSearch
	if (document.getElementById('FastSearchCatchword') && document.getElementById('FastSearchCatchword').value == ''){
		document.getElementById('FastSearchCatchword').value = GetDefaultValues().Catchword;
		document.getElementById('FastSearchCatchword').style.font = GetDefaultValues().StyleFont;
		document.getElementById('FastSearchCatchword').style.color = GetDefaultValues().StyleColorGrey;  
	}
	if (document.getElementById('FastSearchZipTown') && document.getElementById('FastSearchZipTown').value == '') {
		document.getElementById('FastSearchZipTown').value = GetDefaultValues().Town;
		document.getElementById('FastSearchZipTown').style.font = GetDefaultValues().StyleFont;
		document.getElementById('FastSearchZipTown').style.color = GetDefaultValues().StyleColorGrey;
	}
	
	// BranchSearch
	if (document.getElementById('BranchSearchCatchword') && document.getElementById('BranchSearchCatchword').value == ''){
		document.getElementById('BranchSearchCatchword').value = GetDefaultValues().Catchword;
		document.getElementById('BranchSearchCatchword').style.font = GetDefaultValues().StyleFont;
		document.getElementById('BranchSearchCatchword').style.color = GetDefaultValues().StyleColorGrey;  
	}
	if (document.getElementById('BranchSearchZipTown') && document.getElementById('BranchSearchZipTown').value == ''){
		document.getElementById('BranchSearchZipTown').value = GetDefaultValues().Town;
		document.getElementById('BranchSearchZipTown').style.font = GetDefaultValues().StyleFont;
		document.getElementById('BranchSearchZipTown').style.color = GetDefaultValues().StyleColorGrey;
	}
	
	// CircumCircle
	if (document.getElementById('CatchwordCircumCircle') && document.getElementById('CatchwordCircumCircle').value == ''){
		document.getElementById('CatchwordCircumCircle').value = GetDefaultValues().Catchword;
		document.getElementById('CatchwordCircumCircle').style.font = GetDefaultValues().StyleFont;
		document.getElementById('CatchwordCircumCircle').style.color = GetDefaultValues().StyleColorGrey;  
	}
	if (document.getElementById('ZipTownCircumCircle') && document.getElementById('ZipTownCircumCircle').value == ''){
		document.getElementById('ZipTownCircumCircle').value = GetDefaultValues().Town;
		document.getElementById('ZipTownCircumCircle').style.font = GetDefaultValues().StyleFont;
		document.getElementById('ZipTownCircumCircle').style.color = GetDefaultValues().StyleColorGrey;
	}
	
	// CityInfo
	if (document.getElementById('CityInfoSearchZipTown') && document.getElementById('CityInfoSearchZipTown').value == ''){
		document.getElementById('CityInfoSearchZipTown').value = GetDefaultValues().Town;
		document.getElementById('CityInfoSearchZipTown').style.font = GetDefaultValues().StyleFont;
		document.getElementById('CityInfoSearchZipTown').style.color = GetDefaultValues().StyleColorGrey;
	}
	
	// Telefonnummer
	if (document.getElementById('PhoneNo') && document.getElementById('PhoneNo').value == ''){
		document.getElementById('PhoneNo').value = GetDefaultValues().Phone;
		document.getElementById('PhoneNo').style.font = GetDefaultValues().StyleFont;
		document.getElementById('PhoneNo').style.color = GetDefaultValues().StyleColorGrey;
	}
	
	// CityInfo
	if (document.getElementById('CityGuideSearchBranch') && document.getElementById('CityGuideSearchBranch').value == ''){
		document.getElementById('CityGuideSearchBranch').value = GetDefaultValues().Catchword;
		document.getElementById('CityGuideSearchBranch').style.font = GetDefaultValues().StyleFont;
		document.getElementById('CityGuideSearchBranch').style.color = GetDefaultValues().StyleColorGrey;  
	}
	
	// CityGuide
	if (document.getElementById('CityGuideSearchStreet') && document.getElementById('CityGuideSearchStreet').value == ''){
		document.getElementById('CityGuideSearchStreet').value = GetDefaultValues().Street;
		document.getElementById('CityGuideSearchStreet').style.font = GetDefaultValues().StyleFont;
		document.getElementById('CityGuideSearchStreet').style.color = GetDefaultValues().StyleColorGrey;  
	}
	if (document.getElementById('CityGuideSearchZipTown') && document.getElementById('CityGuideSearchZipTown').value == ''){
		document.getElementById('CityGuideSearchZipTown').value = GetDefaultValues().Town;
		document.getElementById('CityGuideSearchZipTown').style.font = GetDefaultValues().StyleFont;
		document.getElementById('CityGuideSearchZipTown').style.color = GetDefaultValues().StyleColorGrey;
	}
	
	// WhitePage
	if (document.getElementById('WhitePageSearchCatchword') && document.getElementById('WhitePageSearchCatchword').value == ''){
		document.getElementById('WhitePageSearchCatchword').value = GetDefaultValues().Name;
		document.getElementById('WhitePageSearchCatchword').style.font = GetDefaultValues().StyleFont;
		document.getElementById('WhitePageSearchCatchword').style.color = GetDefaultValues().StyleColorGrey;  
	}
	if (document.getElementById('WhitePageSearchZipTown') && document.getElementById('WhitePageSearchZipTown').value == ''){
		document.getElementById('WhitePageSearchZipTown').value = GetDefaultValues().Town;
		document.getElementById('WhitePageSearchZipTown').style.font = GetDefaultValues().StyleFont;
		document.getElementById('WhitePageSearchZipTown').style.color = GetDefaultValues().StyleColorGrey;
	}
	
	// WhitePageCircumCircle
	if (document.getElementById('WhitePageSearchCatchwordCircumCircle') && document.getElementById('WhitePageSearchCatchwordCircumCircle').value == ''){
		document.getElementById('WhitePageSearchCatchwordCircumCircle').value = GetDefaultValues().Name;
		document.getElementById('WhitePageSearchCatchwordCircumCircle').style.font = GetDefaultValues().StyleFont;
		document.getElementById('WhitePageSearchCatchwordCircumCircle').style.color = GetDefaultValues().StyleColorGrey;  
	}
	if (document.getElementById('WhitePageSearchZipTownCircumCircle') && document.getElementById('WhitePageSearchZipTownCircumCircle').value == ''){
		document.getElementById('WhitePageSearchZipTownCircumCircle').value = GetDefaultValues().Town;
		document.getElementById('WhitePageSearchZipTownCircumCircle').style.font = GetDefaultValues().StyleFont;
		document.getElementById('WhitePageSearchZipTownCircumCircle').style.color = GetDefaultValues().StyleColorGrey;
	}
}

// Klick aus dem Eingabefeld
function KeepInputFields(Object)
{
  // Die ID des gewählten Reiters speichern.
  InputField = Object.id;
  // alert(Object.value);

  switch (InputField)
    {
    // FastSearch
    case "FastSearchCatchword":
			if(Object.value=='') {
				document.getElementById('FastSearchCatchword').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Catchword;
				}
            break;
    case "FastSearchZipTown":
			if(Object.value=='') {
				document.getElementById('FastSearchZipTown').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Town;
				}
            break;
    // BranchSearch
    case "BranchSearchCatchword":
			if(Object.value=='') {
				document.getElementById('BranchSearchCatchword').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Catchword;
				}
            break;
    case "BranchSearchZipTown":
			if(Object.value=='') {
				document.getElementById('BranchSearchZipTown').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Town;
				}
            break;
    // CircumCircle
    case "CatchwordCircumCircle":
			if(Object.value=='') {
				document.getElementById('CatchwordCircumCircle').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Catchword;
				}
            break;
    case "ZipTownCircumCircle":
			if(Object.value=='') {
				document.getElementById('ZipTownCircumCircle').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Town;
				}
            break;
    // Telefonnummer    
    case "PhoneNo":
			if(Object.value=='') {
				document.getElementById('PhoneNo').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Phone;
				}
            break;
     
    // CityInfo    
    case "CityInfoSearchZipTown":
			if(Object.value=='') {
				document.getElementById('CityInfoSearchZipTown').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().ZipTown;
				}
            break;
    case "CityGuideSearchBranch":
			if(Object.value=='') {
				document.getElementById('CityGuideSearchBranch').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Catchword;
				}
            break;
            
    // Cityguide
    case "CityGuideSearchStreet":
			if(Object.value=='') {
				document.getElementById('CityGuideSearchStreet').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Street;
				}
            break;
    case "CityGuideSearchZipTown":
			if(Object.value=='') {
				document.getElementById('CityGuideSearchZipTown').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Town;
				}
            break;
    // WhitePage
    case "WhitePageSearchCatchword":
			if(Object.value=='') {
				document.getElementById('WhitePageSearchCatchword').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Name;
				}
            break;
    case "WhitePageSearchZipTown":
			if(Object.value=='') {
				document.getElementById('WhitePageSearchZipTown').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Town;
				}
            break;
    // WhitePageCircumCircle            
    case "WhitePageSearchCatchwordCircumCircle":
			if(Object.value=='') {
				document.getElementById('WhitePageSearchCatchwordCircumCircle').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Name;
				}
            break;
    case "WhitePageSearchZipTownCircumCircle":
			if(Object.value=='') {
				document.getElementById('WhitePageSearchZipTownCircumCircle').style.color = GetDefaultValues().StyleColorGrey;
				Object.value = GetDefaultValues().Town;
				}
            break;
    default:
            break;
    }
}

// Klick ins Eingabefeld
function CheckInputFields(Object)
{
  // Die ID des gewählten Reiters speichern.
  InputField = Object.id;

  switch (InputField)
    {
    // FastSearch
    case "FastSearchCatchword":
			if(Object.value == GetDefaultValues().Catchword ) {
				document.getElementById('FastSearchCatchword').style.color = '#000';
				Object.value='';
				}
            break;
    case "FastSearchZipTown":
			if(Object.value == GetDefaultValues().Town ) {
				document.getElementById('FastSearchZipTown').style.color = '#000';
				Object.value='';
				}
            break;
    // BranchSearch
    case "BranchSearchCatchword":
			if(Object.value == GetDefaultValues().Catchword ) {
				document.getElementById('BranchSearchCatchword').style.color = '#000';
				Object.value='';
				}
            break;
    case "BranchSearchZipTown":
			if(Object.value == GetDefaultValues().Town) {
				document.getElementById('BranchSearchZipTown').style.color = '#000';
				Object.value='';
				}
            break;
    // CircumCircle
    case "CatchwordCircumCircle":
			if(Object.value == GetDefaultValues().Catchword ) {
				document.getElementById('CatchwordCircumCircle').style.color = '#000';
				Object.value='';
				}
            break;
    case "ZipTownCircumCircle":
			if(Object.value == GetDefaultValues().Town) {
				document.getElementById('ZipTownCircumCircle').style.color = '#000';
				Object.value='';
				}
            break;
    // Telefonnummer    
    case "PhoneNo":
			if(Object.value == GetDefaultValues().Phone) {
				document.getElementById('PhoneNo').style.color = '#000';
				Object.value='';
				}
            break;
    // CityInfo    
    case "CityInfoSearchZipTown":
			if(Object.value == GetDefaultValues().Town) {
				document.getElementById('CityInfoSearchZipTown').style.color = '#000';
				Object.value='';
				}
    case "CityGuideSearchBranch":
			if(Object.value == GetDefaultValues().Catchword) {
				document.getElementById('CityGuideSearchBranch').style.color = '#000';
				Object.value='';
				}
            break;
            break;
    // CityGuide
    case "CityGuideSearchStreet":
			if(Object.value == GetDefaultValues().Street) {
				document.getElementById('CityGuideSearchStreet').style.color = '#000';
				Object.value='';
				}
            break;
    case "CityGuideSearchZipTown":
			if(Object.value == GetDefaultValues().Town) {
				document.getElementById('CityGuideSearchZipTown').style.color = '#000';
				Object.value='';
				}
            break;    
    // WhitePage
    case "WhitePageSearchCatchword":
			if(Object.value == GetDefaultValues().Name ) {
				document.getElementById('WhitePageSearchCatchword').style.color = '#000';
				Object.value='';
				}
            break;
    case "WhitePageSearchZipTown":
			if(Object.value == GetDefaultValues().Town) {
				document.getElementById('WhitePageSearchZipTown').style.color = '#000';
				Object.value='';
				}
            break;
    // WhitePageCircumCircle
    case "WhitePageSearchCatchwordCircumCircle":
			if(Object.value == GetDefaultValues().Name ) {
				document.getElementById('WhitePageSearchCatchwordCircumCircle').style.color = '#000';
				Object.value='';
				}
            break;
    case "WhitePageSearchZipTownCircumCircle":
			if(Object.value == GetDefaultValues().Town) {
				document.getElementById('WhitePageSearchZipTownCircumCircle').style.color = '#000';
				Object.value='';
				}
            break;
    default:
            break;
    }
}

var PopUpElem = null;
var PopUpElemTimeout = null;

function OnShowPoiPopUp(PopUp)
{
	if (!PopUpElem || PopUpElem.getId() != PopUp.getId())
	{
		PopUpElem = PopUp.Clone(true);
		PopUpElem.origPopUp = PopUp;
		// Popup in der Karte ausblenden:
		PopUpElem.origPopUp.Hide();
		if (PopUpElem.origPopUp.Element)
			PopUpElem.origPopUp.Element.style.display = 'none';
	}
	PopUpElem.Show();
	// XPos und YPos sind in Utility.js definiert (aktuelle Mauspos)
	PopUpElem.RealDraw(document.body, XPos, YPos);
}


function ShowInfoPageComplete(id)
{
	//ShowPoiPopUp(id, OnShowPoiPopUp);
	ShowPoiPopUp(id);
	HighlightPoiPoint(id);
}
function EnablePopUpElem()
{
	PopUpElem.origPopUp.CurrentOpacity = 0;
	PopUpElem.origPopUp.RealHide();
	PopUpElem.origPopUp.Element.style.display = 'block';
}
function HideInfoPageComplete(id)
{     
		if (PopUpElem)
		{
			PopUpElem.Hide();
			PopUpElem.origPopUp.CurrentOpacity = 0;
			PopUpElem.origPopUp.RealHide();
			clearTimeout(PopUpElemTimeout);
			PopUpElemTimeout = setTimeout('EnablePopUpElem()', 500);
		}
        HidePoiPopUp();
        UnHighlightPoiPoint();
}
function DateInput(DateName, Required, DateFormat, DefaultDate) {}