function arg (argName){
  // Get URL argument by name
  // document.write("Start function");
  var result;
  var startVar;
  var endVar;
  var searchStr;

  searchStr=argName+"=";
  result="undefinEd";
  startVar=document.URL.indexOf(searchStr);
  startVar=1+document.URL.indexOf("=",startVar);
  if (startVar>0){
    endVar=document.URL.indexOf("&",startVar);
    if (endVar>0)
      result=document.URL.substr(startVar,endVar-startVar);
    else
      result=document.URL.substr(startVar,document.URL.length-startVar);
  }
  return result;
}


function showMenu( pathToRoot,MenuItem){
	 document.write("<BR/>");
//Welkom	
	 document.write("<DIV CLASS=\"menu\">");
	 document.write("<UL>");
	   document.write("<LI><a href=\"" + pathToRoot + "index.php\">");
 	     if (MenuItem=="Welkom")
	       document.write("<b>Welkom</b></a></LI>");
       else
	 	     document.write("Welkom</a></LI>");
//	 document.write("<LI><a href=\"" + pathToRoot + "Verhuizing/index.html\">Verhuizing</a></LI>");
	 document.write("</UL>");
	 document.write("</DIV>");

	 document.write("<BR/>");
//Nieuws	 
	 document.write("<DIV CLASS=\"menu_head\">Nieuws</DIV>");
	 document.write("<DIV CLASS=\"menu\">");
	 document.write("<UL>");
	   document.write("<LI><a href=\"" + pathToRoot + "Nieuws/Nieuws.php?Pagina=16\">");
 	     if (MenuItem=="Nieuws")
	       document.write("<b>(Rijnland in het) Nieuws</b></a></LI>");
       else
	 	     document.write("(Rijnland in het) Nieuws</a></LI>");
	   document.write("<LI><a href=\"" + pathToRoot + "Nieuws/Agenda.php\">");
 	     if (MenuItem=="Agenda")
	       document.write("<b>Agenda</b></a></LI>");
       else
	 	     document.write("Agenda</a></LI>");
	   document.write("<LI><a href=\"" + pathToRoot + "Nieuws/Bar.php\">");
 	     if (MenuItem=="Bar")
	       document.write("<b>Bar open</b></a></LI>");
       else
	 	     document.write("Bar open</a></LI>");
//	   document.write("<LI><a href=\"" + pathToRoot + "Nieuws/Simpelveld.html\">");
// 	     if (MenuItem=="Simpelveld")
//	       document.write("<b>Motorrijdende Kanoërs</b></a></LI>");
//       else
//	 	     document.write("Motorrijdende Kanoërs</a></LI>");
	   document.write("<LI><a href=\"" + pathToRoot + "Nieuws/Wijzigingen.php\">");
 	     if (MenuItem=="Wijzigingen")
	       document.write("<b>Wijzigingen</b></a></LI>");
       else
	 	     document.write("Wijzigingen</a></LI>");
	   document.write("<LI><a href=\"" + pathToRoot + "Foto/Fotos.php\">");
 	     if (MenuItem=="Fotos")
	       document.write("<b>Foto's</b></a></LI>");
       else
	 	     document.write("Foto's</a></LI>");
	   document.write("<LI><a href=\"" + pathToRoot + "Disciplines/Rijnvaarder/Jaarkeuze.php\">");
 	     if (MenuItem=="Rijnvaarder")
	       document.write("<b>Rijnvaarder</b></a></LI>");
       else
	 	     document.write("Rijnvaarder</a></LI>");
	 document.write("</UL>");
	 document.write("</DIV>");
	 
	 document.write("<BR/>");
//Bestuur
	 document.write("<DIV CLASS=\"menu_head\">Bestuur</DIV>");
	 document.write("<DIV CLASS=\"menu\">");
	 document.write("<UL>");
	   document.write("<LI><a href=\"" + pathToRoot + "Bestuur/Bestuur.php\">");
 	     if (MenuItem=="Bestuursleden")
	       document.write("<b>Bestuursleden</b></a></LI>");
       else
	 	     document.write("Bestuursleden</a></LI>");
	   document.write("<LI><a href=\"" + pathToRoot + "Bestuur/Contributie.php\">");
 	     if (MenuItem=="Contributie")
	       document.write("<b>Contributie</b></a></LI>");
       else
	 	     document.write("Contributie</a></LI>");
	   document.write("<LI><a href=\"" + pathToRoot + "Bestuur/InschrijfFormulier.php\">");
 	     if (MenuItem=="InschrijfFormulier")
	       document.write("<b>Inschrijfformulier</b></a></LI>");
       else
	 	     document.write("Inschrijfformulier</a></LI>");
	   document.write("<LI><a href=\"" + pathToRoot + "Bestuur/Reglementen.php\">");
 	     if (MenuItem=="HuisRegels")
	       document.write("<b>Statuten/Huish. reg.</b></a></LI>");
       else
	 	     document.write("Statuten/Huish. reg.</a></LI>");
	   document.write("<LI><a href=\"" + pathToRoot + "Bestuur/SchoonmaakRooster.php\">");
 	     if (MenuItem=="SchoonmaakRooster")
	       document.write("<b>SchoonmaakRooster</b></a></LI>");
       else
	 	     document.write("SchoonmaakRooster</a></LI>");
// 	   document.write("<LI><a href=\"" + pathToRoot + "Bestuur/Mededelingen.html\">");
// 	     if (MenuItem=="Mededelingen")
//	       document.write("<b>Mededelingen</b></a></LI>");
//       else
//	 	     document.write("Mededelingen</a></LI>");
   document.write("<LI><a href=\"" + pathToRoot + "Bestuur/Ledenlijst/LedenlijstSQL.php\">");
 	     if (MenuItem=="Ledenlijst")
	       document.write("<b>Ledenlijst</b></a></LI>");
       else
	 	     document.write("Ledenlijst</a></LI>");
   document.write("<LI><a href=\"" + pathToRoot + "BuurmanEnBuurman/ToDo.php\">");
 	     if (MenuItem=="BuurmanEnBuurman")
	       document.write("<b>Buurman &#38; Buurman</b></a></LI>");
       else
	 	     document.write("Buurman &#38; Buurman</a></LI>");
	 document.write("</UL>");
	 document.write("</DIV>");
	 document.write("<BR/>");
//Disciplines
	 document.write("<DIV CLASS=\"menu_head\">Disciplines</DIV>");
	 document.write("<DIV CLASS=\"menu\">");
	 document.write("<UL>");
	   document.write("<LI><a href=\"" + pathToRoot + "Disciplines/Algemeen.php\">");
 	     if (MenuItem=="Algemeen")
	       document.write("<b>Algemeen</b></a></LI>");
       else
	 	     document.write("Algemeen</a></LI>");
	   document.write("<LI><a href=\"" + pathToRoot + "Disciplines/Vlakwater/Vlakwater.php\">");
 	     if (MenuItem=="Vlakwater")
	       document.write("<b>Vlakwater</b></a></LI>");
       else
	 	     document.write("Vlakwater</a></LI>");
/*	   document.write("<LI><a href=\"" + pathToRoot + "Disciplines/UnderConstruction.html\">");
 	     if (MenuItem=="Wildwater")
	       document.write("<b>Wildwater</b></a></LI>");
       else
	 	     document.write("Wildwater</a></LI>");
	 document.write("<LI><a href=\"" + pathToRoot + "Disciplines/UnderConstruction.html\">Branding</a></LI>");
*/
	 document.write("<LI><a href=\"" + pathToRoot + "Disciplines/Kanopolo/KanoPolo.html\">Kanopolo</a></LI>");
	   document.write("<LI><a href=\"" + pathToRoot + "Disciplines/Instructie/Cursus.php\">");
 	     if (MenuItem=="Instructie")
	       document.write("<b>Introductie cursus</b></a></LI>");
       else
	 	     document.write("Instructie</a></LI>");
//	   document.write("<LI><a href=\"" + pathToRoot + "Disciplines/Schoolsport/Schoolsport.html\">");
// 	     if (MenuItem=="Schoolsport")
//	       document.write("<b>Schoolsport</b></a></LI>");
//       else
//	 	     document.write("Schoolsport</a></LI>");
	document.write("</UL>");
	 document.write("</DIV>");
	 document.write("<BR/>");
// Links
	 document.write("<DIV CLASS=\"menu_head\">Links</DIV>");
	 document.write("<DIV CLASS=\"menu\">");
	 document.write("<UL>");
	 document.write("<LI><a href=\"http://www.nkb.nl\">Nederlandse Kano Bond</a></LI>");
	 document.write("<LI><a href=\"http://www.felix-kanosport.nl\">Felix kanosport</a></LI>");
	 document.write("<LI><a href=\"http://kcksamorin.sk\">KCK Samorin</a></LI>");
	 document.write("<LI><a href=\"http://kano.startkabel.nl\">Kano Startkabel</a></LI>");
	 document.write("<LI><a href=\"http://kanopolo.startbewijs.nl\">Kanopolo startbewijs</a></LI>");
	 document.write("<a href=\"http://www.kano.opzijnbest.nl/\" target=\"_blank\"><img src=\"http://www.opzijnbest.nl/images/vinkje2.gif\" alt=\"kano\" width=\"14\" height=\"15\" border=\"0\"/></a><a href=\"http://www.kano.opzijnbest.nl/\" target=\"_blank\"><strong>Kano</strong></a> opzijnbest.nl");
	 document.write("</UL>");
	 document.write("</DIV>");
	 document.write("<BR/>");
	 document.write("<P/>");
 	 document.write("<center><a href='http://www.interboatmarinas.nl' target=_blank>");
 	 document.write("<img alt='Interboat Marinas' src='" + pathToRoot + "Images/ButtonIBMkanorijnland.jpg' class='button_active' height='118px' width='145px'>");
	 document.write("<br><img alt='Interboat Marinas' src='" + pathToRoot + "Images/InterboatMarinas.jpg' class='button_active' height='65px' width='145px'></a></div></center>");

}

// --------------------------------------------------------------------------
// Start de layout van de pagina. Deze functie moet in het begin van de body 
// tag staan en verzocht de kop van de pagina en de menu weergave.
// param pathToRoot = string om naar root dir te komen.
//				voorbeeld: "../" => root is 1 level hoger
//				voorbeeld: "" 	 => we staan in de root
// --------------------------------------------------------------------------
function startPage( pathToRoot,MenuItem ){
	/* Pagina kop */
	document.write( "<A NAME=\"TOP\"></A>" );
	document.write( "<CENTER><TABLE CLASS=\"page\">");
	document.write( "<TR CLASS=\"page_head\"><TD COLSPAN=\"2\">");
	document.write( "<img src=\""+ pathToRoot + "Images/Header.jpg\" height=\"80\" width=\"800\">");
	document.write( "</TD></TR>");

	/* Menu kolom */
	document.write("<TR><TD CLASS=\"page_menu\" VALIGN=\"top\">");
	showMenu( pathToRoot,MenuItem );
	document.write("</TD><TD class=\"page_inhoud\" VALIGN=\"top\">");
}

// --------------------------------------------------------------------------
// Beeindigt de layout van de pagina. Deze functie moet in het einde staan 
// vlak voor de afsluitende body tag.
// --------------------------------------------------------------------------
function endPage(){
	document.write("</TD></TR>");
	document.write("</TABLE></CENTER>");
}

var VolgNummer;
function ViewImages(BestandNaam,Thumb,Aantal)
{
  Y=1;
  for (X=1;X<Aantal+1; X++) 
  {
    if (X<10) {VolgNummer="0"+X;}else{VolgNummer=X;}
		if (Y>3)
		{
		  Y=1;
			document.write("<br>");
	  }
		document.write("<a href=\"Images/Brand/"+BestandNaam+VolgNummer+".jpg\" target=\"Foto\"><img src=\"Images/Brand/"+Thumb+VolgNummer+".jpg\" alt=\"Klik voor grote afbeelding\" border=\"2\" hspace=\"1\" vspace=\"1\"></a>")
    //document.write("<a href=\"GrootFormaat.html#Plaatje=Images/Brand/"+BestandNaam+VolgNummer+".jpg\"><img src=\"Images/Brand/"+Thumb+VolgNummer+".jpg\" alt=\"Klik voor grote afbeelding\" border=\"2\" hspace=\"1\" vspace=\"1\"></a>")
		Y=Y+1;
  }
}

function ShowTekstHeader(String1,pathToRoot)
{
  document.write("<p><center><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr height=\"40px\">");
  document.write("<td background=\"" + pathToRoot + "Images/LeftMenu.jpg\" width=\"40px\" border=\"0\">&nbsp;</td>");
  document.write("<td background=\"" + pathToRoot + "Images/TussenMenu.jpg\" width=\"550px\"><center><strong><font color=\"#ff9933\">"+String1+"</font></strong></center></td>");
  document.write("<td background=\"" + pathToRoot + "Images/RightMenu.jpg\" width=\"40px\" border=\"0\">&nbsp;</td></tr></table></center>");
}
 
