﻿function showFullscreen(url)
{
	height = screen.availHeight;
	width = screen.availWidth;
	
	// Windows 2k fix
	if(navigator.userAgent.indexOf('Windows NT 5.0') != -1)
	{
		height = height - 20;
		width = width - 10;
	}

	try
	{
		tmp = window.open(url, 'tmp', "height=" + height + "px,width=" + width + "px,top=0,left=0,location=0,menubar=0,resizable=0,scrollbars=0,toolbar=0");
		tmp.resizeTo(width, height);
	}
	catch(e) {;}
}

function showNormal(url)
{	
	try
	{
		tmp = window.open(url, '', "height=" + screen.availHeight + "px,width=" + screen.availWidth + "px,top=0,left=0,location=1,menubar=1,resizable=1,scrollbars=1,toolbar=1");
		tmp.resizeTo(screen.availWidth,screen.availHeight);
	}
	catch (e) {;}
}

function maximizeCurrentWindow()
{
	try
	{
		top.window.moveTo(0,0);
		
		if (document.all)
		{
			var newWidth = screen.availWidth;
			var newHeight = screen.availHeight;
			
			top.window.resizeTo(newWidth, newHeight);
			
			shouldRemove = false;
			if(window.screenTop < 0)
			{
				newHeight = screen.availHeight - window.screenTop;
				shouldRemove = true;
			}
			
			if(window.screenLeft < 0)
			{
				newWidth = screen.availWidth - window.screenLeft;
				shouldRemove = true;
			}
				
			if(shouldRemove)
			{
				top.window.resizeTo(newWidth, newHeight);
				top.window.moveTo(0,0)
			}
		}
		else if (document.layers||document.getElementById)
		{
			if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
				top.window.outerHeight = screen.availHeight;
				top.window.outerWidth = screen.availWidth;
			}
		}
	}
	catch (e) {}
}