// ======= Flash-Pano Routinen =======
// call in das Flash-Pano
function displaySite(siteID)
{
	document.getElementById("baseObject").call("call(displaySite,"+siteID+")");
}
// wird vom Flash-Pano aufgerufen
function getBrowserURL()
{
	return document.location.href;
}
// wird vom Flash-Pano aufgerufen
function displaySample(url, flashvars, width, height, bgcolor)
{
	overlay_show(url, flashvars, width, height, bgcolor);
}

// ======= Overlay Routinen =======
function overlay_show(url, flashvars, width, height, bgcolor)
{
//alert("overlay_show: "+url+","+flashvars+","+width+","+height+","+bgcolor);
	document.getElementById("overlay").style.display = "block";
	document.getElementById("overlay").style.backgroundColor = bgcolor;
	if ( isIE() ) { document.getElementById("overlay").style.width = "101%" } else { document.getElementById("overlay").style.width = "100%" };
	if ( isIE() ) { document.getElementById("overlay").style.height = "101%" } else { document.getElementById("overlay").style.height = "100%" };
	// Tween zum Einblenden des Overlay
	var tween = new OpacityTween(document.getElementById("overlay"),null,0,100,1);
	tween.onMotionFinished = overlay_show_complete;
	tween.start();
	// ditour-DIV initialisieren
	var swf = createswf(url, "diTour", flashvars, width, height);
	swf.embed("ditour");
}
function overlay_show_complete()
{
	// Overlay-Content DIV formatieren
	var windowWidth = window.innerWidth; if (typeof(windowWidth)==='undefined') windowWidth = document.body.clientWidth;
	var windowHeight = window.innerHeight; if (typeof(windowHeight)==='undefined') windowHeight = document.body.clientHeight;
	document.getElementById("overlayContent").style.display = "block";
	document.getElementById("overlayContent").style.top = (windowHeight-600)/2;
	document.getElementById("overlayContent").style.left = (windowWidth-900)/2;
}


function overlay_hide()
{
	var tween = new OpacityTween(document.getElementById("overlay"),null,100,0,1);
	tween.onMotionFinished = overlay_hide_complete;
	tween.start();
}
function overlay_hide_complete()
{
	// ditour-DIV leeren, um nicht die Tour im Hintergrund weiterlaufen zu lassen
	document.getElementById("overlay").style.display = "none";
	document.getElementById("ditour").innerHTML=''
}

// ======= Utility Routinen =======
function isIE()
{
	if ( navigator.appName.indexOf("Internet Explorer") != -1 ) { return true }
	else { return false }
}
