// ----------------------------------------------------------------------
// Globale Standardwerte setzen
//-----------------------------------------------------------------------
var browserID = "MZ";
if (navigator.userAgent.indexOf("MSIE") != -1)
	browserID = "IE";
	
var pageStatus = 0; // Overview	
var mediaZoom = 0;

var winWidth, winHeight;
var bgWidth, bgHeight;
var bgPath = "xvga";

if (screen.width > 1280) 
	bgPath = "uxga";
else if (screen.width > 1024)
	bgPath = "sxga";

// ----------------------------------------------------------------------
// Hintergrund an Fenstergröße anpassen
//-----------------------------------------------------------------------
function Get_ClientSize()
{
	var w, h;
	
	if (self.innerHeight)
	{
		w = self.innerWidth;
		h = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
	{
		w = document.documentElement.clientWidth;
		h = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		w = document.body.clientWidth;
		h = document.body.clientHeight;
	}

	winWidth = w;
	winHeight = h;

	if (w > h * 1.78)
		h = w * 0.5625;
	else if (h > w * 0.5625)
		w = h * 1.78;

	bgWidth = w;
	bgHeight = h;
}

function Adjust_Layer()
{
	Get_ClientSize();
	document.getElementById("background0").style.width = winWidth + "px";
	document.getElementById("background0").style.height = winHeight + "px";
	document.getElementById("bg0").style.width = bgWidth + "px";
	document.getElementById("bg0").style.height = bgHeight + "px";
	
	if (bgSlides)
	{
		document.getElementById("background1").style.width = winWidth + "px";
		document.getElementById("background1").style.height = winHeight + "px";
		document.getElementById("bg1").style.width = bgWidth + "px";
		document.getElementById("bg1").style.height = bgHeight + "px";
	}
	
	var w, h;
	
	if (mediaZoom)
	{
		document.getElementById("fullsize").style.width = winWidth + "px";	
		document.getElementById("fullsize").style.height = winHeight + "px";
		fullWidth = winWidth - 336;
		if (pageStatus == 3)  // Slideshow
		{
			w = sldSize[2];
			h = sldSize[3];
		}
		else if (pageStatus == 5)	// Video
		{
			var data = mediaVid.split("|");
	
			w = data[3];
			h = data[4];
		}
		
		if (w > fullWidth)
		{
			h = Math.floor(h * fullWidth / w);
			w = fullWidth;
		}
		document.getElementById("fullmedia").style.width = w + "px";		
		document.getElementById("fullmedia").style.height = h + "px";		
		document.getElementById("fullinfo").style.height = h + "px";		
	}
}

window.onresize = Adjust_Layer; 

function Do_Click(e) 
{
	if (!e)
		e = window.event;
	if ((e.type && e.type == "contextmenu") || (e.button && e.button == 2) || (e.which && e.which == 3)) 
	{
    	return false;
	}
}

function Do_Drag()
{
	return false;
}

if (top.location == this.location)
{		
	document.onmousedown = Do_Click;
	document.oncontextmenu = Do_Click;
	document.ondragstart = Do_Drag;
}
