<!-- Begin
var idSeparator = '%%%';

function makeMenuIdentifier(Title,Item)
{
var Ident = Title;
if (Item != "" && Item != " ") Ident = Ident + idSeparator + Item;
return Ident;
}

function replaceChars(myString, inChar, replaceChar)
{
var ResultString = "";
var index = 0;
var prevIndex = 0;

while ((index = myString.indexOf(inChar, prevIndex)) >= 0)
   {
   ResultString += myString.substring(prevIndex, index) + replaceChar;
   prevIndex = index+inChar.length;
   }
ResultString += myString.substring(prevIndex, myString.length);

return ResultString;
}

// =================================================
// Check whether the user came through the main page,
// or through a direct link to a subpage.
function throughMainPage() {
// window.alert(self.location+' - '+top.location);
// Indien je rechtstreeks gaat, is top.location gelijk aan self.location. 
//	  Uitzondering: als je rechtstreeks naar "contentsframe.html" gaat, is top.location "contentsframe.html".
// Indien je via de hoofdpagina binnenkomt, is top.location .../olvebadminton/
// self.location geeft .../main.html als je rechtstreeks gaat, of .../pagina.html als via hoofdpagina naar pagina geklikt wordt.

// Controleer of we rechtstreeks een pagina hebben ingetikt.
test = top.location.toString();
subStringsArray = test.split("/");
if (self.location == top.location || subStringsArray[subStringsArray.length-1] == "contentsframe.html")
	{
	// We are not in a frame from a frameset, so probably arriving from a search engine
	return false;
	}
else
	{
	return true;
	}

}

function setMenuFrame(frame)
{
// frame should be an ancestor of all objects that want to use getMenuFrame()
frame.menuFrameIsMe = true;
}

function getMenuFrame()
{
frame = this;
// Find the frame to which the menu is attached.
// It can be recognized by the property menuFrameIsMe
// It should be set as being the upper frameset
// This is done in setMenuFrame
// ==== Reason: with URL forwarding and cloaking, top appears to be a window at the forwarding server,
//              not at the hosting server
while (frame.menuFrameIsMe != true)
	{
	if (frame == top) return null;
	frame = frame.parent;
	}
return frame;
}

function setActiveTopic(Title,Item)
{
menuFrame = getMenuFrame();
if (menuFrame == null) return;
menuFrame.myActiveMenu = makeMenuIdentifier(Title,Item);
}

function getActiveTopic()
{
// initially, top.myActiveMenu is deliberately not initialized
menuFrame = getMenuFrame();
if (menuFrame != null && menuFrame.myActiveMenu) return menuFrame.myActiveMenu;
return "";
}

function getTitleIdentifier(Ident)
{
if (getActiveTopic().indexOf(idSeparator) == -1) return Ident;
return getActiveTopic().substring(0,getActiveTopic().indexOf(idSeparator));
}

// Can be called from the contentsframe. These are always html files in a subdirectory with respect to the main directory
function changeUrl(Title, Item)
{
changeUrlWithDir(Title, Item, "../");
}

// Here, you specify the relative directory with respect to the main directory
// From within html in the main directory (e.g. leftupperframe), use "" for RelDir
function changeUrlWithDir(Title, Item, RelDir)
{
if (!throughMainPage())
	{
	window.alert("You followed a direct link to a subpage.\n\nYou will now be redirected to:\n\n\"www.olvebadminton.be\"");
	window.location.href = "http://www.olvebadminton.be";
	return;
	}


// Item could end with local reference to an anchor name:  #someName
var localRef = "";
var localIndex = Item.indexOf("#");
if (localIndex > -1) 
   {
   localRef = makeTitleRef(Item.substring(localIndex,Item.length));
   Item = Item.substring(0,localIndex);
   }

// Pick up the reference associated with the menu
menuFrame = getMenuFrame();
if (menuFrame == null) return;
var newUrl = menuFrame.myMenu.getRef(Title, Item);
setActiveTopic(Title,Item);
if (menuFrame.leftUpperFrame)
   {
   // Laad de URL
   // top.leftUpperFrame.location.href="../leftupperframe.html";
   menuFrame.leftUpperFrame.location.reload(true);
   }
if (newUrl != "") 
   {
   newUrl = RelDir+newUrl;
   menuFrame.ContentsFrame.location.href = newUrl+localRef;
   }
}


function addCrossLink(Title, Item, Text)
{
//document.write('<a href=\"../home/main.html\"  onclick=\"javascript: changeUrl(\'');
document.write('<a href=\"javascript:void(0)\"  onclick=\"javascript: changeUrl(\'');
document.write(Title+'\',\''+Item+'\'); return false\">');
document.write(Text+'</a>'); 
}


function addTopLink()
{
document.write('<a href=\"#topreference\" onMouseOver=\"javascript: window.status=\'Naar inhoudstafel\'; return true\" onMouseOut=\"javascript: window.status=\'\'; return true\">');
document.write('<span style=\"font-family: verdana, helvetica, sans-serif; font-size: 10px; color: #2F7158;text-decoration: none;\"><b>[</b>Naar inhoudstafel<b>]</b></span>');
document.write('</a><br><br>');
}

// ==========================================
function DatumEuropeseWeergave(datum) 
{
var dag = datum.getDate();
var maand = datum.getMonth() + 1;
var maand2 = ((maand < 10) ? "0" : "") + maand;
var jaar = datum.getYear();
if (jaar < 70) 
   {
   var jaar4 = (jaar + 2000);
   }
else 
   {
   var jaar4 = ((jaar < 1900) ? (jaar + 1900) : (jaar));
   }
var datumwaarde = dag + "-" + maand2 + "-" + jaar4;
return datumwaarde
}

function writeLastModified(VoorTekst)
{
var gewijzigd = new Date(document.lastModified);
var wijzigdatum = VoorTekst + DatumEuropeseWeergave(gewijzigd);
document.write(wijzigdatum);
}



// ==========================================
var width = 870;
var areaheight = 74;

function writeBodyStart()
{
document.write('<div id="wrapper">');
document.write('  <div id="content"> ');
document.write('<span id="header">');
}

function writeHeader(TitleText)
{
writeHeader2(TitleText, "Laatst gewijzigd op ");
document.write('</span>');  // header
document.write('    <div id="main">');
}

function writeBodyEnd()
{
document.write('     </div>');// main
document.write('     <div id="logo">');
// TEST: document.write('<a  href="../home/main.html" target="ContentsFrame" onclick=\'javascript: toggle("")\'>[Hoofdpagina]</a>');
document.write('     </div>');
document.write('  </div>');// content
document.write('</div>');  // wrapper
}


function writeHeader2(TitleText, ModifiedText)
{
// Te doen: invullen! Hier wordt de header weggeschreven!
document.write('<center>'+TitleText+'</center>');
document.write('<span style="font-size: 10px;"><br><br>&nbsp;');
writeLastModified(ModifiedText);
document.write('</span>');
}

function makeTitleRef(TitleText)
{
return replaceChars(replaceChars(replaceChars(TitleText," ","_"), "<br>",""), "&nbsp;","");
}

function writeTitleRef(TitleText, prefix, postfix)
{
// Write reference to title
document.write(prefix);
document.write('<a href=\"#'+makeTitleRef(TitleText)+'\">'+replaceChars(TitleText,"<br>","")+'</a>');
document.write(postfix);
}

function writeTitle(TitleText, Align, Lines)
{
var doCentering;

if (Lines < 0) Lines = 1;
height = Lines * 20;
height += 4;

// browsers seem not to behave the same way
if (navigator.userAgent.indexOf("Opera") >= 0)
   {
   // For some reason, centering doesn't work
   doCentering = false;
   }
else 
   {
   doCentering = true;
   }

if (doCentering == false) Align = "left";
if (Align != "left" && Align != "center") {Align = "center";}


if (Align == "center") document.write('<center>');
// Place the container

// Set anchor for indexing
document.write('<a name=\"'+makeTitleRef(TitleText)+'\"></a>');
document.write('<p><span class=title>'+TitleText+'</span></p>');

if (Align == "center") document.write('</center>');
}

// Genereert een mailto-statement.
// Bedoeling is mailadressen te verbergen voor misbruik door spammers
function schrijfNaar(name, adress)
{
document.write("<a href=\"mailto:"+name+"@"+adress+"\">");
}

//  End -->
