// Externes Buchungsformular laden
function loadExternalForm()
	{
	// wenn Inhaltsbereich leer
	if(document.getElementById('externalContent').firstChild)
		{
		// SPID ermitteln
		var SPID;
		SPID = getURLParameter('SPID');

		// Wenn SPID, dann Detailseite, sonst Suchseite
		if(SPID!='null' && SPID.length > 0)
			{ document.writeln('<iframe frameborder="0" margin="0" scrolling="auto" width="730" height="1000" src="http://www.thueringen-reise.com/irs/TPortalRegion/start.jsp?TOID=NDH&MODULE=MOD_SP_PRES&VAC_PROFILE=1&SPID='+SPID+'"></iframe>'); }
		else
			{ document.writeln('<iframe frameborder="0" margin="0" scrolling="auto" width="730" height="1000" src="http://www.thueringen-reise.com/irs/TPortalRegion/start.jsp?TOID=NDH&MODULE=MOD_VAC"></iframe>'); }
		}
	}

// einzelnen URL-Parameter auslesen
function getURLParameter(name)
	{ 
    return unescape( 
        (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] 
    ); 
	}


// Druckfenster anzeigen
function openPrint(url,w,h)
	{
    l = screen.width/2-50;
    t = screen.height/2-150;
    w = eval(w) + 16;
    options = "width="+w+",height="+h+",left="+l+",top="+t+",menubar=yes,resizable=yes,scrollbars=yes,status=yes";
    Druckwindow = window.open(url,'Details',options);
    Druckwindow.focus();
	}


// Druckfenster anzeigen - Variante 2
function printWindow(url)
	{
	window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=400,screenX=150,screenY=150,top=150,left=150');
	}


// Funktion zum Setzen einer Bookmark / eines Favoriten
function CreateBookmarkLink(url,title)
	{
	//url = "Webpage URL";
	//title = "Webpage Title";
	if(window.sidebar)
		{
		// Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
		}
	else if(window.external)
		{ // IE Favorite
		window.external.AddFavorite( url, title);
		}
	else if(window.opera && window.print)
		{ // Opera Hotlist
		return true;
		}
	}


function Stadtrundgang(lang)
	{
	url = 'v1/CMM_Stadtrundgang/index.php';
	w = 780;
	h = 485;
	l = (screen.width/2)-(w/2);
	t = (screen.height/2)-(h/2)-50;
	//w = eval(w) + 16;
	options = 'width='+w+',height='+h+',left='+l+',top='+t+',menubar=no,resizable=no,scrollbars=no,status=yes';
	StadtrundgangWindow = window.open(url,'Stadtrundgang',options);
	StadtrundgangWindow.focus();
	}


function Kreisrundgang(lang)
	{
	url = 'v1/CMM_Kreisrundgang/index.php';
	w = 880;
	h = 650;
	l = (screen.width/2)-(w/2);
	t = (screen.height/2)-(h/2)-50;
	//w = eval(w) + 16;
	options = 'width='+w+',height='+h+',left='+l+',top='+t+',menubar=no,resizable=no,scrollbars=no,status=yes';
	StadtrundgangWindow = window.open(url,'Kreisrundgang',options);
	StadtrundgangWindow.focus();
	}


function showHideSitemapItem(currentObject)
	{
	if(currentObject.parentNode.nextSibling)
		{
		// Kind-Element identifizieren
		sublevelObject = currentObject.parentNode.nextSibling;
		// Style aendern und Icon-Element (+/-) umschalten
		if(sublevelObject.style.display == 'block')
			{
			sublevelObject.style.display = 'none';
			currentObject.src = 'fileadmin/SITE/icons/icon-sitemap-plus.gif';
			}
		else
			{
			sublevelObject.style.display = 'block';
			currentObject.src = 'fileadmin/SITE/icons/icon-sitemap-minus.gif';
			}
		}
	}
