/*	author:	Leander Eyer, TQ Team C001348
	date:	19.04.2000

	This script was worte for the internetsite "chess the royal game"
	by Think Quest team C001348 */

options = new Array (
	"width=600,height=500,resizable=yes,scrollbars=no,status=yes,toolbar=no,menubar=no,location=no,directories=no",
	"width=770,height=470,resizable=yes,scrollbars=no,status=yes,toolbar=no,menubar=no,location=no,directories=no", 
	"width=450,height=350,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,directories=no",
	"width=700,height=500,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,directories=no",
	"width=600,height=400,resizable=yes,scrollbars=no,status=yes,toolbar=no,menubar=no,location=no,directories=no");

function isloaded (subURL) 
{ //make sure the frameset is loaded 
	if (parent.frames.length == 0)
	{
		var language = true;
		
		//check language
		if (subURL.substring (subURL.length - 8, subURL.length - 5) == "_ge")
			language = false;
		else
			language = true; 

		var root = new String ( location );
		root = root.substr ( 0, root.length - subURL.length); 
		//generate the frameset 
		with (document) 
		{
			clear ();
			writeln ("<HTML><HEAD><TITLE>Chess The Royal Game</TITLE></HEAD>");
			writeln ("<FRAMESET rows = '40,*' border='0' framespacing='0' frameborder='no'>");
			writeln ("	<FRAME src='" + root + "head" + (language? "_en":"_ge") + ".html' name='head' noresize scrolling='no'>");
			writeln ("	<FRAME src = '" + root + subURL + "' name = 'site' noresize>");
     		writeln ("</FRAMESET></HTML>");
			close ();
		}

		if ((navigator.appName == "Netscape") && (parseInt (navigator.appVersion) >= 5))
		{
			status = "Netscape 6 or higher detected -> trying to compensate ...";
			resizeTo (outerWidth - 50, outerHeight - 50);
			resizeTo (outerWidth + 50, outerHeight + 50);
		} else 
			frames [1].location = root + subURL;
		return;
	}
}

function openwin (typ, name)
{
	return open ('', name, options [typ]);
}