/*****************************************************************************************************************************

  Project:		Calculation of the seats according to Hare-Niemeyer and d'Hondt
  
  File
  description:	This file includes functions in JavaScript. 
  				Since version Release 1.1 exist this file. In version 1.0,
				this file has just a function to print the document
				and to test which functions are supporting by the browser.
				
  Version:		1.2

  Copyright © 2005-2006 by Andy Liebke. All Rights Reserved.

*****************************************************************************************************************************/

function Print(content)
{
	var hwnd = window.open("","errors","HEIGHT=660,WIDTH=880,left=10,top=50,menubar=yes,scrollbars=yes");
	
	hwnd.focus();
	hwnd.document.write(content);
	hwnd.document.close();
}

/****************************************************************************************************************************/

function GetSumVotes()
{
	document.writeln(g_votes_sum);
}

/****************************************************************************************************************************/

function TestBrowser()
{
	if(navigator.appName == 'Firefox')
	{
		document.writeln('<div class=test_ok>Verf&uuml;gbar</div>');
		return true;
	}
	
	if(navigator.appName == 'Opera')
	{
		document.writeln('<div class=test_ok>Verf&uuml;gbar</div>');
		return true;
	}
	
	if(navigator.appName == 'Safari')
	{
		document.writeln('<div class=test_ok>Verf&uuml;gbar</div>');
		return true;
	}
	
	if(navigator.appName == 'Netscape')
	{
		if(parseInt(navigator.appVersion) >= 4/* || parseInt(navigator.appVersion) >= 6*/)
		{
			document.writeln('<div class=test_ok>Verf&uuml;gbar</div>');
			return true;
		}
		else
			document.writeln('<div class=test_failed>Funktion nicht verf&uuml;gbar.<br>Sie benötigen Nescape Version 4 oder 6!</div>');
	}
	else
	{
		if(navigator.appVersion.indexOf('MSIE 5.0') != -1 || navigator.appVersion.indexOf('MSIE 5.5') != -1 || navigator.appVersion.indexOf('MSIE 6.0') != -1|| navigator.appVersion.indexOf('MSIE 7.0') != -1)
			document.writeln('<div class=test_ok>Verf&uuml;gbar</div>');
		else
			document.writeln('<div class=test_failed>Funktion nicht verf&uuml;gbar.<br>Sie benötigen MS Internet Exploerer Version 5 oder h&ouml;her!</div>');
	}
}

/****************************************************************************************************************************/