function ThisIsIExplorer()
{
	var browser = new BrowserInfo();

	return (browser.IsIExplorer);
}
function ThisIsNetscape()
{
	var browser = new BrowserInfo();

	return (browser.IsNetscape);
}


var browser = null;
function BrowserInfo()
{
	var ms = navigator.appVersion.indexOf("MSIE");
	var ns = navigator.userAgent.indexOf("Netscape");
	var op = navigator.userAgent.indexOf("Opera");
	var mac = navigator.appVersion.indexOf("Macintosh");
	
	this.IsIExplorer = (navigator.appName == "Microsoft Internet Explorer");	
	this.IsNetscape = (navigator.appName == "Netscape");						
	this.IsOpera = (navigator.appName == "Opera");							
	this.MajorVnr = parseInt(navigator.appVersion.substring(0, 1));
	this.Vnr = 0;
	if(this.IsIExplorer)
	{
		this.ID = "IE";
		this.Vnr = parseInt(navigator.appVersion.substring(ms+5, ms+6));
		this.Name = navigator.appVersion.substring(ms, ms+8);
	}
	if(this.IsNetscape)
	{
		this.ID = "NS";
		this.Vnr = parseInt(navigator.userAgent.substr(ns+9, ns+10));
		this.Name = navigator.userAgent.substr(ns);
	}
	if(this.IsOpera)
	{
		this.ID = "OP";
		this.Vnr = parseInt(navigator.userAgent.substring(op+6, op+7));
		this.Name = navigator.userAgent.substr(op);
	}
}
// globale Variable die das Debug Window hält
debugWindow = null;
function AddDebugInformationAboutWindow()
{
	if (window == null)
	{
		AddDebugMessage("Das window - Objekt ist NULL!");
	}
	else
	{
		AddDebugMessage("window.document="+window.document.name)
		AddDebugMessage("window.parent="+window.parent.name)
		AddDebugMessage("window.self="+window.self.name)
		AddDebugMessage("window.top="+window.top.name)
		AddDebugMessage("window.window="+window.window.name)
		AddDebugMessage("Anzahl frames ="+window.length)
	}
	/*
	else
	{
		AddDebugMessage("Objekt: " + object + " Type: "+ typeof(object));
	}
	*/
}

function AddDebugInformationAboutDocument(yDocument)
{
	if (yDocument == null)
		yDocument = document;
		
	if (yDocument == null)
	{
		AddDebugMessage("Das übergebene document - Objekt ist NULL!");
	}
	else 
	{
		AddDebugMessage("document.title="+yDocument.title)
		AddDebugMessage("document.url="+yDocument.URL)
		AddDebugMessage("document.referrer="+yDocument.referrer)
		AddDebugMessage("document.domain="+yDocument.domain)
		AddDebugMessage("document.parentWindow(IE)="+yDocument.parentWindow.self)
		AddDebugMessage("document.images.length="+yDocument.images.length)
		AddDebugMessage("document.links.length="+yDocument.links.length)

		AddDebugMessage("-------------------------------------------------");
		for (i = 0; i < yDocument.all.length; i++) 
		{
			AddDebugMessage("Element: " + yDocument.all[i].name + " id: " + yDocument.all[i].id)
		}
		AddDebugMessage("-------------------------------------------------");
	}
}
function AddDebugInformationAboutIFrame(yIFrame)
{
	if (yIFrame== null)
	{
		AddDebugMessage("Das übergebene IFrame - Objekt ist NULL!");
	}
	else 
	{
		//AddDebugMessage("iframe.id="+yIFrame.id);

		AddDebugMessage("iframe.Name="+yIFrame.name);
		AddDebugMessage("iframe.document="+yIFrame.document);
		AddDebugMessage("iframe.document.URL="+yIFrame.document.URL);
		AddDebugMessage("iframe.location="+yIFrame.location);
		/* ist heutzutage alle undefined
		AddDebugMessage("iframe.scrolling="+yIFrame.scrolling);

		AddDebugMessage("iframe.height="+yIFrame.height);
		AddDebugMessage("iframe.width="+yIFrame.width);

		AddDebugMessage("iframe.border="+yIFrame.border);
		AddDebugMessage("iframe.frameborder="+yIFrame.frameborder);
		
		AddDebugMessage("iframe.vspace="+yIFrame.vspace);
		AddDebugMessage("iframe.hspace="+yIFrame.hspace);
		
		AddDebugMessage("iframe.marginheight="+yIFrame.marginheight);
		AddDebugMessage("iframe.marginwidth="+yIFrame.marginwidth);
		*/

	}
}
function AddDebugInformationAboutLocation()
{
	if (location == null)
	{
		AddDebugMessage("Das location-objekt ist NULL!");
	}
	else 
	{
		AddDebugMessage("location.hash="+location.hash)
		AddDebugMessage("location.host="+location.host)
		AddDebugMessage("location.hostname="+location.hostname)
		AddDebugMessage("location.href="+location.href)
		AddDebugMessage("location.pathname="+location.pathname)
		AddDebugMessage("location.port="+location.port)
		AddDebugMessage("location.protocol="+location.protocol)
		AddDebugMessage("location.search="+location.search)
	}
}
function AddDebugInformationAboutNavigator()
{
	if (navigator == null)
	{
		AddDebugMessage("Das navigator-objekt ist NULL!");
	}
	else 
	{
		AddDebugMessage("navigator.appCodeName="+navigator.appCodeName)
		AddDebugMessage("navigator.appName="+navigator.appName)
		AddDebugMessage("navigator.appVersion="+navigator.appVersion)
		AddDebugMessage("navigator.platform="+navigator.platform)
		AddDebugMessage("navigator.userAgent="+navigator.userAgent)
	}
}

function AddDebugInformationAboutBrowser()
{
	var browser = new BrowserInfo();
	
	if (browser == null)
	{
		AddDebugMessage("Das browser-objekt ist NULL!");
	}
	else 
	{
		AddDebugMessage("browser.ID="+browser.ID)
		AddDebugMessage("browser.Name="+browser.Name)
		AddDebugMessage("browser.IsIExplorer="+browser.IsIExplorer)
		AddDebugMessage("browser.IsNetscape="+browser.IsNetscape)
		AddDebugMessage("browser.IsOpera="+browser.IsOpera)
		AddDebugMessage("browser.MajorVnr="+browser.MajorVnr)
		AddDebugMessage("browser.Vnr="+browser.Vnr)
	}
}
function AddDebugMessage(yStringLine)
{
	if (debugWindow == null)
	{
		debugWindow = OpenDebugWindow();
		debugWindow.document.open();
		debugWindow.document.write("<style type='text/css'> body {font-family: Tahoma; font-size:10pt;}</style>");
	}
	debugWindow.document.writeln(yStringLine+"<br>") 
}
function OpenDebugWindow()
{
	return open("","debugWindow","width=400 height=400 resizable scrollbars");
}
function CloseDebugWindow()
{
	debugWindow.close();
}


