if (document.all)
	document.getElementsByTagName = ie_getElementsByTagName

var pages = new Array();

var rubriekenHashTable = {};
rubriekenHashTable.algemeen = 1;
rubriekenHashTable.doelstellingen = 2;
rubriekenHashTable.stage = 3;
rubriekenHashTable.rekrutering = 4;
rubriekenHashTable.infoverstrekking = 5;
rubriekenHashTable.extra = 6;

function ShowImage(img)
{
	foto1= new Image();
	foto1.src=(img);
	CheckSize(img);
}

function CheckSize(img)
{
	if((foto1.width!=0)&&(foto1.height!=0))
	{	ViewImage(img);
	}
	else
	{	recheck="CheckSize('"+img+"')";
		recheckInterval=setTimeout(CheckSize,20);
	}
}

function ViewImage(img)
{
	fWidth  = foto1.width+0;
	fHeight = foto1.height+0;

	ksk = window.open('','ShowImage','width='+fWidth+',height='+fHeight+',toolbar=no,scrollbars=no,resizable=no');
	ksk.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>");
	ksk.document.write("<html><head><title>www.morganownersgroup.be</title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'></head>");
	ksk.document.write("<body bgcolor='#FFFFFF' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><img src='" + img + "'></body></html>")
	ksk.document.close();
}

function ie_getElementsByTagName(str)
{
	if (str=="*")
		return document.all
	else
		return document.all.tags(str)
}

function getElements()
{
	var obj = document.getElementsByTagName("*")
	for (var i=0;i < obj.length;i++)
	var el = obj[i]	// get the element
}

function loadPages()
{
	var i = 0;
	var txt = '';
	
	if (!document.getElementById){ return null; }
	var paginas = document.getElementsByTagName('div');

	for (var j=0; j<paginas.length; j++)
	{
		whichEl = paginas[j];
		if (whichEl.className == "rubriek") pages[i++] = whichEl;
	}
}

function setPageVisibility(page,style)
{
	if (page)
	{
		page.className = 'rubriek_' + style;
	}
}

function hidePage(nr)
{
	setPageVisibility(pages[nr-1],'none');
}

function hideAllPages()
{
	for (i=0;i<pages.length;i++)
		setPageVisibility(pages[i],'none');
}

function showPage(rubrieknaam)
{
	var nr = rubriekenHashTable[rubrieknaam];
	if (pages[nr-1]) hideAllPages();
	setPageVisibility(pages[nr-1],'block');
}

function externalLinksSetup()
{
	var a;
	for (var i = 0; (a = document.links[i]); i++) {
		if (a.className && a.className == 'external') {
			a.target = '_blank';
		}
	}
}

function navListClick()
{
	showPage(this.href.substr(this.href.lastIndexOf('#')+1));
	return true;
}

function navListSetup()
{
	var a;
	for (var i = 0; (a = document.links[i]); i++) {
		if (a.className == 'rub') {
			a.onclick = navListClick;
		}
	}
}

window.onload=function()
{
	externalLinksSetup();
	navListSetup();
	loadPages();
	hideAllPages();
	var loco = new String(document.location);
	var octathorpe = loco.substr(loco.lastIndexOf('#')+1);
	//if (octathorpe.length>1) showPage(octathorpe);
	//else
	showPage('algemeen');
}