var arMenu = new Array() ;
/*----------------------------------------------------------------------------------------------- 
| Indeling arMenu[volgnr] = naam hoofdgroep, naam ondewerp-1[#URL], naam ondewerp-2[#URL], etc	|	
|	   indien #URL ontbreekt, dan is de "naam ondewerp" de basis voor de URL 		|
| arMenu[4en 5] worden bijgewerkt door Fotoboek programma op PC					|
-----------------------------------------------------------------------------------------------*/
/*----------Groep1---------------------------------------------------------------------------*/
arMenu[0]  = "";
arMenu[1]  = "Verwaal Tuinen BV,Wie zijn wij,In de media,Info,Website links,AVLB,Logon#javascript:popupPW()";
arMenu[2]  = "Tuinaanleg,Tuinplan,Voorbereiding,Afwerking,Materialen";	
arMenu[3]  = "Onderhoud,Tuin onderhoud,Gazon onderhoud,Vijver onderhoud";
arMenu[4]  = "Projecten";		//deze wordt bij uitvoering ingevuld
arMenu[5]  = "Foto album";		//deze wordt bij uitvoering ingevuld

/*----------Groep2---------------------------------------------------------------------------*/
arMenu[11]  = "Algemeen,Registratie";
arMenu[12]  = "Bezoekers,Bezoekers";
arMenu[13]  = "Projecten";		//deze wordt bij uitvoering ingevuld
arMenu[14]  = "Foto album";		//deze wordt bij uitvoering ingevuld
arMenu[15]  = "Logoff,Logoff#javascript:top.fToonStartPagina()"

document.write('<scr'+'ipt type="text/javascript" src="../includes/menu.js" ></scr'+'ipt>');

//WindowStatusMsg("0#Hoveniersbedrijf C.J. Verwaal   --   www.cjverwaal.nl   --   bel 0343-552000 of 06-53945731   --   ");


/*----------------------------------------------------------------------------------------------*/
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 fToonTrace(parm) {
//	//myteller,HR OffsetTop,body clientheight(=frame)#doc.body.clientheight,frame height
//	if (oTA.IP_Name != "")
//	{
//		aWerk = mElement("ip").innerHTML.split("#")
//		if (aWerk.count = 0)
//			aWerk[1] = "0"
//		aWerk[0] = parm
//		mElement("ip").innerHTML = aWerk.join("#")
//	}
//}

/*----------------------------------------------------------------------------------------------*/
function ToonGroepen(Groep) {
/*-----------------------------------------------------------------------------------------------
| Deze functie wordt aangeroepen uit index.php (Groep=1) of html\logon.php (Groep=2)		|
| De functie toont in de horizontale menu balk de aanwezige hoofdgroepen  			|
| Is Groep=1 dan wordt de Introductie (menu001.html) gestart.					|
| Is Groep=2 dan wordt de Logon (logon.html) gestart.						|   	
-----------------------------------------------------------------------------------------------*/

  var tWerk  = new Array();
  var regel  = "";
  var pagina = "";
  var i = 0;
  var x = 0;

  if (Groep == 1) 		//Standaard Groepen
  {
  	beginmenu = 1;
  	eindemenu = 5; 
  }
  else if (Groep == 2) 		//Administratie
  {
	beginmenu = 11;
       	eindemenu = 15; 
  }
  
  regel = "";
  for (i = beginmenu; i<= eindemenu; ++i)  
  {
      	tWerk = arMenu[i].split(",");
	x = tWerk[1].indexOf("#");
	if (x > -1) 
	    	pagina = tWerk[1].substr(x+1)

	else if (i == 4 || i == 5) 
       		pagina = "html/album.php?collectie=" + tWerk[0].toLowerCase() + "&album=" + tWerk[1].toLowerCase();

	else if (i < 10)
		pagina = "html/" + tWerk[1].toLowerCase() + ".html";

	else if  (i == 11) 
		pagina = "html/" + tWerk[1].toLowerCase() + ".html?pw=" + oTA.LogonPW;

	else if  (i == 12) 
		pagina = "html/bezoeker.php?data=" + oTA.LogonPW + "," + tWerk[0].toLowerCase() + "," + tWerk[1].toLowerCase(); 

	else if  (i == 13 || i == 14) 
		pagina = "html/totalen.php?data=" + oTA.LogonPW + "," + i; 



	pagina = pagina.replace(/ /g, "");

    	regel  += '|&nbsp;&nbsp;<a href=' + pagina + ' target=frameOnderwerp class=menu2>';
    	regel  += tWerk[0];
    	regel  += '</a>&nbsp;&nbsp;';
  }
  mElement("idgroepen").innerHTML = regel ;
}

/*----------------------------------------------------------------------------------------------*/
function fToonStartPagina() {		//na mouseclick op Logo 
    ToonGroepen(1)
    mElement("frameOnderwerp").src="html/intro.html"

    if (oTA.LogonPW != "") {
	fPanorama();
        
    }
}
/*----------------------------------------------------------------------------------------------*/
function changeRule(theNumber) {
	var theRules = new Array();
	if (document.styleSheets[0].cssRules) {
		theRules = document.styleSheets[0].cssRules;
	}
        else if (document.styleSheets[0].rules) {
		theRules = document.styleSheets[0].rules;
	}
	theRules[theNumber].style.backgroundColor = '#FF0000';
}
/*----------------------------------------------------------------------------------------------*/
function fPanorama() { 
var i, y, regel;
    regel = "";
    y = Math.floor(Math.random() * tPanorama.length)	//getallen van 0  t/m aantal in tPanorama
    for (i=0; i<6; i++) {			 	//ophalen 6 fotos vanaf random getal
        y = y + 1
	if (y == tPanorama.length) y = 0
	regel += '<img src="panoramas/' + tPanorama[y] + '" width=125 border=0>'
    }
    mElement("panorama").innerHTML = regel;
}

/*----------------------------------------------------------------------------------------------*/
function trim(str) {
    if (str) {
     	s = str.replace(/^(\s)*/, '');
     	s = s.replace(/(\s)*$/, '');
     	return s;
    }
    else
    	return str;
} 

/*----------------------------------------------------------------------------------------------*/
function fTelBezoek() {
    if (oTA.bTelBezoek == 1) {
	oXmlUser.Url        = "http://www.tuinanders.nl/html/tellen.php"; 
	oXmlUser.doNext     = "fTelBezoek1()";
	oXmlUser.berichtHdr = "collectie=bezoekers&album=bezoekers";
	oXmlUser.fSendEnVervolg() ;
    }
}

function fTelBezoek1() {
    if (oXmlUser.rc > 0)
	window.status = "2#rc= " + oXmlUser.rc + ", " + oXmlUser.response
}

/*----------------------------------------------------------------------------------------------*/
function WindowStatusMsg(parm) { 
return
    tWerk = parm.split("#");

    if (tWerk[0] == "0") {
	text = tWerk[1];
  	window.status = text;
  	setTimeout("WindowStatusMsg('1');",300);
    }
    else if (tWerk[0] == "1")   { 
  	text = text.substring(1,text.length) + text.substring(0,1); 
	window.status = text;
  	setTimeout("WindowStatusMsg('1');",300);
    }
    else if (tWerk[0] == "2") { 
	window.status = tWerk[1];
  	setTimeout("WindowStatusMsg('1');",3000);
    }
}

/*----------------------------------------------------------------------------------------------*/
function fInitialiseer() {
    fPanorama()
    fTelBezoek()
    if (oTA.bTelBezoek == 0) mElement("ip").innerHTML = "0"

    if (oTA.Afzender == "") 	
  	fToonStartPagina()

    else {
	tabParse = oTA.Afzender.split(",");
	for (ix=1; ix < tabParse.length; ix++) {	
	    tabParse[0] += (ix == 1)? "?": "&";
	    tabParse[0] += tabParse[ix];
	}
  	ToonGroepen(1)
  	mElement("frameOnderwerp").src="../" + tabParse[0];
    }
}

