// Levert de scripts voor oa de stylesheets, hr, update ed.
// Wordt steeds geladen door elke opgestarte pagina
// No Rights, Rule-off
// Vragen? Rule-off@wanadoo.nl

//----- Globale variabelen	-----\\

// Houd bij of pagina geladen is (dat is bij update)
// Index wacht totdat geladen == true
var geladen = 0;

// Detecteer de 'basis' (verschil online/offline)
var basis="http://home.wanadoo.nl/rule-off/";
if (location.href.indexOf("file://") != -1)
	basis="file://c:/homepage/";

// Detecteert of browser Netscape is of niet
var isNs = true;
if (navigator.appName.indexOf("Netscape") == -1 )
	isNs = false;

//----- Aanroep van de benodigde functies -----\\

instCss ();
rightClick ();

//----- Direct gebruikte functies -----\\

// Importeert de goeie stylesheet
function instCss ()
{
//	if (!isNs)
//	{
		document.write(
			'<LINK REL="stylesheet" TYPE="text/css" HREF="', basis, 'style_ie.css">'
		);
//	}
//	else
//	{
//		document.write(
//			'<LINK REL="stylesheet" TYPE="text/css" HREF="', basis, 'style_ns.css">'
//		);
		// letter-grootte kan afhangen van de schermgrootte
//		var size=75;
//		if (screen.availHeight > 1000)
//			size=100;
//		document.write(
//			'<STYLE>',
//			'BODY,P,TR,TD,OL,UL {font-size:', size, '%;}',
//			
//		);
//	}
}

// Geen right-click bij online-modus
function rightClick ()
{
	if (basis.indexOf("file://c:") == -1)
	{
		document.write(
			'<SCRIPT for=document event=oncontextmenu>',
				'event.returnValue=copyright();',
			'</SCRIPT>'
		);
	}
}
function copyright () {
	alert("No Rights, Rule-off");
	return false;
}

//----- Door de pagina te gebruiken functies -----\\

// Forceert frames. vb str="../index.htm?wis/wiskunst.htm"
// wordt omgezet tot: ../index.htm?url=wis/wiskunst.htm&frame=main&via=.."
// Regelt tevens de statusbalk-tekst
function force(docstr)
{
	if (top.location.href.indexOf("index.htm") == -1)
	{
		// de locatie (welk frame) evt. achterhalen
		var loc = "main";
		var pos = docstr.indexOf("&");
		if (pos != -1)
		{
			loc = docstr.substring(pos+1, docstr.length);
			docstr = docstr.substring(0, pos);
		}
		docstr += "&loc=" + loc;
		
		// "url=" op de goede plek er tussen plakken
		pos = docstr.indexOf("?");
		docstr = docstr.substring(0, pos) + "?url=" + docstr.substring(pos+1, docstr.length);

		// evt. referrer meegegeven, 'via' erachter
		docstr += "&via=";
		docstr += parent.document.referrer;
		top.location.href = docstr;
		}
	// regelt window status
	var posBegin = docstr.indexOf("?");
	docstr = docstr.substring (posBegin+1, docstr.length);
	var posEinde = docstr.indexOf("&");
	if (posEinde != -1)
		docstr = docstr.substring (0, posEinde);
	var voorStr = "Huidige pagina: ";
	if (docstr.indexOf("boven") + docstr.indexOf("linkerbalk") == -2)
		window.defaultStatus = voorStr + docstr + " | no rights, rule-off";

	geladen = 1;
}

// Regelt hr, een mooie horizontale lijn
function hr()
{
	if (screen.availWidth <= 640)
	{
		document.write (
			'<CENTER><IMG SRC="', basis, 'img/hr.jpg"></CENTER>'
		);
	}
	else
	{
		document.write (
			'<CENTER><IMG SRC="', basis, '/img/hr500.jpg"></CENTER>'
		);
	}
}

// Regelt 'update' onderaan
function update (datum)
{
	hr ();
	document.write (
		'<CENTER><FONT CLASS="update">laatste update van déze pagina ',
		datum, ' | no rights, rule-off</FONT></CENTER>'
	);
}

geladen = 1;

//----- Einde style.js -----\\
