/*	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 */

function isloaded (subURL) 
{ 	
		var language;
		//check language
		if (subURL.substring (subURL.length - 8, subURL.length - 5) == "_ge")
			language = false;
		else
			language = true; 

	//make sure the frameset level 1 is loaded 
	if (parent == self)
	{
		var root = new String ( location );
		root = root.substr ( 0, root.length - subURL.length); 
		var root2 = root.substr (0, root.length - 24);
		//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='" + root2 + "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 = subURL;
		return;
	}

	//make sure the frameset level 2 is loaded 
	if (parent.parent == parent)
	{
		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 cols = '150,*' border='0' framespacing='0' frameborder='no'>");
			writeln ("	<FRAME src='" + root + "overview" + (language? "_en":"_ge") + ".html' name='overview' noresize scrolling='auto'>");
			writeln ("	<FRAME src = '" + root + subURL + "' name = 'text' 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 = subURL;
	}
}