
hoogte = 160 
fotofn = 0

bTrace = true 
function trace(parm1,parm2) {
  if (bTrace ==  true)  mElement("trace" + parm1).innerHTML= parm2
}

var arMenu = new Array() 

// titel # naam 1e menu entry tevens URL @ overwrite URL @ toelichting # naam 2e menu entry tevens URL @ overwrite URL @ toelichting 

arMenu[0]  ="Art Class#Over Art Class@overartclass#Wat doet Art Class@watdoenwij#Contact"
arMenu[1]  ="Workshops#Totaalkunstwerk#Groepswerk#Kosten workshops@kostenworkshops#Referentie@referenties"
arMenu[2]  ="Cursus#Schildercursus#Kosten cursus@kostencursus"
arMenu[3]  ="Voorbeelden#Eigen werk@eigenwerk#Referenties"
arMenu[4]  ="Scholen#Basisschool@basisschool"

PopupMenu = "xx"
idTimer   = setTimeout("HideMenu();",1);

x = location.href.lastIndexOf("/")
y = location.href.lastIndexOf(".")
var pagina = location.href.substring(x+1,y).toLowerCase()
var arWerk = location.href.split("?")
var parms = arWerk[1]


function mElement(elementName) {
  if (document.all) var cEl = eval('document.all.' + elementName); 			//IE 4 en 5
  else if (document.getElementById) var cEl = document.getElementById(elementName);	//W3C standard (NN6)
  return cEl;
}


function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function HideMenu() {
  if (PopupMenu != "xx")  mElement(PopupMenu).style.visibility = "hidden"  
}




function PrintMenu(parm) {
	if (parm == 0) {  //geen home of toonteller
		regel  = '<img src=../images/leeg.gif width=100% height=10 >'	
		regel += '<img src=../images/separator.jpg width=100% height=1><a href=home.html onMouseOver=HideMenu() class=menu3 >Home</a>'
		document.write(regel)
	}
	
	AantalInEigengroep = 0
	for (y in arMenu) {
		regel  = '<img src=../images/leeg.gif width=100% height=9 >'  
		regel += '<img src=../images/separator.jpg width=100% height=1>'  
		regelSubMenu = ""

		Eigengroep = 0

 		arWerk = arMenu[y].split("#") 

		for (z in arWerk)  {
			z = parseInt(z)
 
			arDetail = arWerk[z].split("@")
 			if (arDetail.length == 0) 
				arDetail[1] = arDetail[0].toLowerCase()

 			else if (arDetail.length == 1) {
				arDetail[1] = arDetail[0].toLowerCase()
				arDetail[2] = arDetail[0] 
			}

			else if (arDetail.length == 2) 
				arDetail[2] = arDetail[0]
			
			if (arDetail[1].length == 0) 
                                arDetail[1] = arDetail[0].toLowerCase() 
			

			x = arDetail[1].length
			while (1==1) {
				if ( arDetail[1].substring(0,4)  == "http") break
				if ( arDetail[1].substring(0,11) == "javascript:") break
				if (arDetail[1].substring(x-4, x) == ".php") break
				arDetail[1] += ".html"
				break
			}


			if (z == 0) {
				MenuGroepNaam  = arDetail[0]
				MenuGroepStart = arDetail[1]
			}
 
			if (z == 1) MenuGroepStart = arDetail[1]

			if (z > 0 ) {	
				x = arDetail[1].indexOf(".")
				if (arDetail[1].substring(0, x) == pagina) {
					Eigengroep = 1
					AantalInEigengroep = arWerk.length}

				if ( arDetail[1].substring(0,4) == "http") 
 					regelSubMenu += '<a href="' + arDetail[1] + '" target="_blank" class=menu2 title="' + arDetail[2] + '">' + arDetail[0]  + '</a><br>' 
				else
 					regelSubMenu += '<a href="' + arDetail[1] + '" class=menu2 title="' + arDetail[2] + '">' + arDetail[0]  + '</a><br>' 
			}  
		}
 

		if (arWerk.length == 1 ) {
			regel += '<div id="m'  + y + '" onMouseOver=HideMenu()>' 
			if (MenuGroepStart == "waarschuwingen.html")
				regel += '<a href=' + MenuGroepStart + ' class=menu3  ><font id=www color=#0000ff>' + MenuGroepNaam + '</font>&nbsp;&nbsp;</a></div>'
			else
				regel += '<a href=' + MenuGroepStart + ' class=menu3  >' + MenuGroepNaam + '&nbsp;&nbsp;</a></div>'
                }
		
		else if ( Eigengroep > 0 )  {
			regel += '<div id="m'  + y + '" )>' 
  			regel += '<a href=' + MenuGroepStart + ' class=menu3 >' + MenuGroepNaam + '&nbsp;&nbsp;</a></div>'
                	regel += '<div align=right onMouseOver=HideMenu() style="position: relative;" >' 
			regel +=  regelSubMenu
  			regel += "<img src=../images/leeg.gif height=4 ><br>"
			regel += '</div>'	
                }       
 
		else {
			regel += '<div id="m'  + y + '" onMouseOver=AanUit(' + y + ')>' 
  			regel += '<a href=' + MenuGroepStart + ' class=menu3  >' + MenuGroepNaam + '&nbsp;&nbsp;</a></div>' 
  			regel += '<div id="l'  + y + '" class=LayerMenu>' 
  			regel += "<img src=../images/leeg.gif height=4 ><br>"
			regel +=  regelSubMenu 
  			regel += "<img src=../images/leeg.gif height=4 ><br>"
			regel += '</div>'
		}
		document.write(regel)
  	}

 	if ((pagina == "home") || (pagina == "toonteller")) 
		vuller=0
	else {
		AantalInEigengroep = AantalInEigengroep - 1
		if (AantalInEigengroep < 0) AantalInEigengroep = 0
  		vuller = document.body.clientHeight - 380 - (AantalInEigengroep*12) 
 		vuller = (vuller > 0)? vuller: 0;
 	}

	regel  = '<img src=../images/leeg.gif width=10 height=' + vuller + '>'
 	document.write(regel)
//alert(regel)
}    

function AanUit(parm){
	clearTimeout(idTimer)

	if (location.href.length > 9) {
		x = location.href.length - 9	
		z = (location.href.substring(x) == "home.html")? 18: 0;
	}

	if (PopupMenu != "xx") mElement(PopupMenu).style.visibility = "hidden"
	PopupMenu = "l" + parm 
	x = mElement("m" + parm).offsetTop
	y = mElement("l_tabel").offsetTop
	

    	mElement(PopupMenu).style.top = x + y + z 

    	mElement(PopupMenu).style.left =  parseInt((document.body.clientWidth - 750)  / 2) + 140
    	mElement(PopupMenu).style.visibility = "visible"

	idTimer=setTimeout("HideMenu();",10000);	
}


function panorama(aantal) {
  tWerk = new Array(1,2,3,4,5,6)
  dcook = unescape(document.cookie)
 
  i = dcook.indexOf("panorama=")
  if (i > -1) {
    j = dcook.indexOf(";",i)
    if (j == -1) j = dcook.length
    parm = dcook.substring(i + 9, j)
    tWerk = parm.split(",")
  }

  regel = "<div class=panorama>"
  for (i in tWerk) {
    if (i == aantal) break 
    ptr = tWerk[i]
    k = tFoto[ptr].substring(0,1)
    if (aantal == 5) regel += '<img  src=../reportages' + tDir[k] + tFoto[ptr].substring(1,tFoto[ptr].length) + '_0.jpg  width=118 height=88 border=0>'
    else regel += '<img  src=../reportages' + tDir[k] + tFoto[ptr].substring(1,tFoto[ptr].length) + '_0.jpg  width=122 height=92 border=0>'
  }
  regel += "</div>"
  document.write(regel)
}


function ToonPW() {
  if ( (document.cookie.indexOf("pw=2") > -1) || (document.cookie.indexOf("pw=1") > -1)) {
    setCookie("pw",0)
    mElement("l_logon").innerHTML = "Logon"
  }

  else if (mElement("logonmenu").style.visibility == "visible")   
    mElement("logonmenu").style.visibility = "hidden"

  else {
    mElement("logonmenu").style.top = mElement("l_logon1").offsetTop - 100
    mElement("logonmenu").style.left = mElement("l_logon").offsetLeft - 50
    mElement("logonmenu").style.visibility = "visible"
    mElement("pw").value = ""
    mElement("pw").focus()
  }
}

function ValiderenPW() {

  if ((mElement("pw").value.length < 1) || (mElement("pw").value.length > 8))	
    	alert("password niet ingevuld of ongeldig")

  else if  (mElement("pw").value.toLowerCase() == "diashow") {
	ToonPW()
	setCookie("pw",2 )
	mElement("l_logon").innerHTML = "Logoff"
	}
  else
    	location.href = "toonteller.asp?" + mElement("pw").value
}

String.prototype.trim = function() {
 var s = this.toString();
 while (s.substring(0,1) == ' ')  s = s.substring(1,s.length);
 while (s.substring(s.length-1,s.length) == ' ') s = s.substring(0,s.length-1);
 return s;
}



