self.focus();


	var contentWin = null;
	
	function openContent(url) {
		if(BrowserDetect.OS == "Windows") diff = 30;
		else diff = 50;
		var y = 80+diff;
		var w = screen.width;
		var h = screen.height-y-diff-35; //additional 35 for the startmenu, doc, etc
		var contentURL = "content.html?"+url;
	contentWin = window.open(contentURL, "contentWin", "width="+w+",height="+h+",left=0,top="+y+",toolbar=no,location=no,scrollbars=yes,status=no,resizable=no,fullscreen=no,directories=no" );
		
		setTimeout("checkChildClose()",500);
	}	
	
	function shrinkMain(url) {
		ResizeToInner(screen.width, 80, 0, 0);
		document.body.style.overflow = "hidden";
		openContent(url);
	}
	
	function addFrame(url) {
		totalSize = GetInnerSize();
		document.getElementById('flashcontent').style.height = "80px";
		document.getElementById('contentContainer').innerHTML = "<iframe src=\""+url+"\" id=\"contentFrame\" width=\"100%\" height=\""+(totalSize[1]-80)+"\" frameborder=\"0\" />";
		ResizeToInner(screen.width, screen.height, 0, 0);
		window.moveTo(0,0);
	}
	
	function changeContent(url) {
		if(BrowserDetect.browser == "Firefox") {
			if(!document.getElementById('contentFrame')) addFrame(url);
			else document.getElementById('contentFrame').src = url;

		} else {
			if(!contentWin || contentWin.closed) shrinkMain(url);
			else contentWin.location = url;
		}
		
	}
	
	function closeWin() {
		if(BrowserDetect.browser == "Firefox") {
			totalSize = GetInnerSize();
			document.getElementById('contentContainer').innerHTML = "&nbsp;";
			document.getElementById('flashcontent').style.height = totalSize[1];
		} else {
			if (!contentWin.closed) contentWin.close();
			ResizeToInner(screen.width, screen.height, 0, 0);
			document.body.style.overflow = "hidden";
			updateFlash('single');			
		}
	}
	
	function checkChildClose() {
		if (contentWin.closed) closeWin();
		else setTimeout("checkChildClose()",100)
	}
	
	
	
	function updateFlash(val) {
		var flashObj = document.getElementById("spectraObj");
		flashObj.SetVariable("windowsStatusVariable", val);
	}
	
	function GetInnerSize() {
		var x,y;
		if (self.innerHeight) {
			x = self.innerWidth;
			y = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) {
			x = document.documentElement.clientWidth;
			y = document.documentElement.clientHeight;
		} else if (document.body) {
			x = document.body.clientWidth;
			y = document.body.clientHeight;
		} return [x,y];
	}
	
	function ResizeToInner(w, h, x, y) {
		if (x==undefined) x = window.screenLeft || window.screenX;
		if (y==undefined) y = window.screenTop || window.screenY;
		//window.moveTo(0,0);
		window.resizeTo(screen.availWidth,screen.availHeight);
		var inner = GetInnerSize();
		var ox = screen.availWidth-inner[0];
		var oy = screen.availHeight-inner[1];
		//window.resizeTo(w+ox, h+oy);
		if(h+oy > screen.height) oy = -25;
		if(w+ox > screen.width) ox = 0;
		window.resizeTo(w+ox, h+oy);
		window.moveTo(x,y);
	}
