var IE4		= (document.all && !document.getElementById) ? true : false;
var IE5 	= (document.all && document.getElementById) ? true : false;
var MOZILLA	= (!document.all && document.getElementById) ? true : false;

// URL TEST
if (location.host.toLowerCase() == 'io.net4u.nl')
{
	location.href = 'http://www.net4u.nl/io/';
}
else if (location.host.toLowerCase() == 'www.net4u.nl')
{
	//location.href = 'http://www.net4u.nl/info/';
}
if(location.host.toLowerCase() == 'www.mattenschaakverhalen.nl')
{
	//location.href = 'http://www.mattenschaakverhalen.nl/matten/';
}
// BROWSER TEST
else if (!MOZILLA && !IE4 && !IE5)
{
	location.href = "/_srv-msg/BrowserNotSupported.aspx";
}

function GetElementByID(elementID)
{
	if (IE4) return document.all[elementID];
	if (IE5 || MOZILLA)	return document.getElementById(elementID);
}

function Common_JumpMenuChanged(elementID, url, key)
{
	var menu = this.GetElementByID(elementID);
	var value = menu.options[menu.selectedIndex].value;
	
	if (value == -1) return;
	
	location.href = url + "&" + key + "=" + value;;
}
function showBorder()
{
	if(this.GetElementByID("produkt2534") != null)
	{
	var im = this.GetElementByID("produkt2534");
	im.style.border = 0;
	}
}
function ShowLargerView(imageFilename)
{
	var vf = window.open(imageFilename, 'Frank', 'status=no,scrollbars=yes,menubar=no,toolbar=no,width=500,height=500')
	with ( vf.document )
	{	
		open();
		write('<HTML>\r\n<HEAD>\r\n<TITLE>Image larger view</TITLE>\r\n');
		write('\t<script language="JavaScript">\r\n');
		write('\tfunction size_to_fit(){\r\n');
		write('\tvar height = document.images[0].height;\r\n');  
		write('\tvar width = document.images[0].width;\r\n');  
		write('\tif (window.innerWidth){\r\n');  
		write('\t\twindow.innerWidth = width;\r\n');  
		write('\t\twindow.innerHeight = height;\r\n\t}\r\n');  
		write('\t\telse if (window.resizeTo){\r\n');  
		write('\t\twindow.resizeTo(width, height);\r\n');  
		write('\t\tvar correctedX =  document.images[0].width + ((document.images[0].width +12) - document.body.clientWidth);\r\n');  
		write('\t\tvar correctedY =  document.images[0].height + ((document.images[0].height +61) - document.body.clientHeight);\r\n');  
		write('\t\twindow.resizeTo(correctedX, correctedY);\r\n\t}\r\n');  

		write('\t}</script>\r\n</head>\r\n');
		write('<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="size_to_fit()">\r\n\t<IMG src="' + imageFilename + '">\r\n');
		write('</BODY>\r\n</HTML>\r\n')
		close()
	}
	
}
function ShowImage(image,imgstyle)
{
	var a = this.GetElementByID(image);
	if(a.style.display == imgstyle) return;
	if(a.style.display == "") a.style.display = "none";
	else a.style.display = "";
}