//BEGIN MENU

 menuItems = new Array();
 menuItemNum = 0;

 function addMenuItem(text, url, img)
{
  if(img) menuItems[menuItemNum] = new Array(text, url, img);

  else if(text) menuItems[menuItemNum] = new Array(text, url);

  else menuItems[menuItemNum] = new Array();

  menuItemNum++;
 }

 menuWidth = 162; //menu width
 menuHeight = 485; //menu height
 menuDelay = 50; //delay before menu appears
 menuSpeed = 8; //speed which menu appears (lower=faster)
 menuOffset = 2; //offset of menu from mouse pointer

 addMenuItem("Home","./index.php");
 addMenuItem();
 addMenuItem("Sprekers","./sprekers.php");
 addMenuItem();
 addMenuItem("Zoek spreker","./zoekspreker.php");
 addMenuItem("Boek spreker","./boekspreker.php");
 addMenuItem("Aanmelden spreker","./aanmeldenspreker.php");
 addMenuItem("Algemene voorwaarden","./sprekeralgvw.php");
 addMenuItem("Veel gestelde vragen","./sprekerfaq.php");
 addMenuItem("Contact","./sprekercontact.php");
 addMenuItem("Prijzen","./sprekerprijzen.php");
 addMenuItem();
 addMenuItem("Artiesten","./artiesten.php");
 addMenuItem();
 addMenuItem("Zoek artiest","./zoekartiest.php");
 addMenuItem("Boek artiest","./boekartiest.php");
 addMenuItem("Aanmelden artiest","./aanmeldenartiest.php");
 addMenuItem("Algemene voorwaarden","./artiestalgvw.php");
 addMenuItem("Veel gestelde vragen","./artiestfaq.php");
 addMenuItem("Contact","./artiestcontact.php");
 addMenuItem("Prijzen","./artiestprijzen.php");
 addMenuItem();
 addMenuItem("Over Ambar","./ambar.php");
 addMenuItem();
 addMenuItem("Contact","./ambarcontact.php");
 addMenuItem("Vacatures","./ambarvacatures.php");
 addMenuItem("Routebeschrijving","./ambarroute.php");
 addMenuItem("Referenties","./ambarreferenties.php");
 addMenuItem("Prijzen","./ambarprijzen.php");
 addMenuItem("Links","./ambarlinks.php");
 addMenuItem("Sitemap","./sitemap.php");

 if(window.navigator.appName == "Microsoft Internet Explorer" && window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE") + 5, window.navigator.appVersion.indexOf("MSIE") + 8) >= 5.5)
  isIe = 1;
 else
  isIe = 0;

 if(isIe)
{
  menuContent = '<table id="rightMenu" width="0" height="0" cellspacing="0" cellpadding="0" style="font:menu;color:menutext;"><tr height="1"><td style="background:threedlightshadow" colspan="4"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedhighlight" colspan="2"></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="10"><td style="background:threedlightshadow"></td><td style="background:threedhighlight"></td><td style="background:threedface"><table cellspacing="0" cellpadding="0" nowrap style="font:menu;color:menutext;cursor:default;">';

  for(m=0;m<menuItems.length;m++){

   if(menuItems[m][0] && menuItems[m][2])

    menuContent += '<tr height="17" onMouseOver="this.style.background=\'highlight\';this.style.color=\'highlighttext\';" onMouseOut="this.style.background=\'threedface\';this.style.color=\'menutext\';" onClick="parent.window.location.href=\'' + menuItems[m][1] + '\'"><td style="background:threedface" width="1" nowrap></td><td width="21" nowrap><img src="' + menuItems[m][2] + '"></td><td nowrap>' + menuItems[m][0] + '</td><td width="21" nowrap></td><td style="background:threedface" width="1" nowrap></td></tr>';

   else if(menuItems[m][0])

    menuContent += '<tr height="17" onMouseOver="this.style.background=\'highlight\';this.style.color=\'highlighttext\';" onMouseOut="this.style.background=\'threedface\';this.style.color=\'menutext\';" onClick="parent.window.location.href=\'' + menuItems[m][1] + '\'"><td style="background:threedface" width="1" nowrap></td><td width="21" nowrap></td><td nowrap>' + menuItems[m][0] + '</td><td width="21" nowrap></td><td style="background:threedface" width="1" nowrap></td></tr>';

   else

    menuContent += '<tr><td colspan="5" height="4"></td></tr><tr><td colspan="5"><table cellspacing="0"><tr><td width="2" height="1"></td><td width="0" height="1" style="background:threedshadow"></td><td width="2" height="1"></td></tr><tr><td width="2" height="1"></td><td width="100%" height="1" style="background:threedhighlight"></td><td width="2" height="1"></td></tr></table></td></tr><tr><td colspan="5" height="3"></td></tr>';
  }

  menuContent += '</table></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedhighlight"></td><td style="background:threedface"></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedshadow" colspan="3"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threeddarkshadow" colspan="5"></td></tr></table>';

  menuPopup = window.createPopup();
  menuPopup.document.body.innerHTML = menuContent;
 }

 function showMenu()
{
  menuXPos = event.clientX + menuOffset;
  menuYPos = event.clientY + menuOffset;
  menuXIncrement = menuWidth / menuSpeed;
  menuYIncrement = menuHeight / menuSpeed;
  menuTimer = setTimeout("openMenu(0,0)", menuDelay);
  return false;
 }

 function openMenu(height, width)
{
  iHeight = height;
  iWidth = width;
  menuPopup.show(menuXPos, menuYPos, iWidth, iHeight, document.body);

  if(iHeight < menuHeight)
   menuTimer = setTimeout("openMenu(iHeight + menuYIncrement, iWidth + menuXIncrement)", 1);
  else
   clearTimeout(menuTimer);
 }

 if(isIe) document.oncontextmenu = showMenu;

//EIND MENU

//BEGIN ROTEER SPREKER

var interval = 1.5; // delay between rotating images (in seconds)
var random_display = 1; // 0 = sequential, 1 = random
interval *= 1000;

var image_index = 0;
image_list = new Array();
image_list[image_index++] = new imageItem("images/1.gif");
image_list[image_index++] = new imageItem("images/2.gif");
image_list[image_index++] = new imageItem("images/3.gif");
image_list[image_index++] = new imageItem("images/4.gif");
image_list[image_index++] = new imageItem("images/5.gif");
image_list[image_index++] = new imageItem("images/6.gif");
image_list[image_index++] = new imageItem("images/7.gif");
image_list[image_index++] = new imageItem("images/8.gif");
image_list[image_index++] = new imageItem("images/9.gif");
image_list[image_index++] = new imageItem("images/10.gif");
image_list[image_index++] = new imageItem("images/11.gif");
image_list[image_index++] = new imageItem("images/12.gif");
var number_of_image = image_list.length;
function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}
function generate(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}
function getNextImage() {
if (random_display) {
image_index = generate(0, number_of_image-1);
}
else {
image_index = (image_index+1) % number_of_image;
}
var new_image = get_ImageItemLocation(image_list[image_index]);
return(new_image);
}
function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
//setTimeout(recur_call, interval);
}

//EIND ROTEER SPREKER




//BEGIN FORM VALIDATION CONTACT

function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function CheckAll(theForm) {
   if (theForm.name.value == "") {
      alert("Vul a.u.b. uw naam in.");
      theForm.name.focus();
      return (false);
   }
   if ((isNaN(theForm.phone.value)) && (theForm.phone.value.length < 10)) {
      alert("Vul a.u.b. een geldig telefoonnummer in.");
      theForm.phone.focus();
      return (false);
   }
  if (theForm.from.value == "")
  {
    alert("Vult u a.u.b. uw e-mailadres in.");
    theForm.from.focus();
    return (false);
  }
  if (!isEmailAddr(theForm.from.value))
  {
    alert("Vult u a.u.b. een geldig e-mailadres in in de vorm : uwnaam@uwdomein.com");
    theForm.from.focus();
    return (false);
  }
   if (theForm.info.value == "") {
      alert("Wat is uw boodschap?");
      theForm.info.focus();
      return (false);
   }
   if (theForm.info.value == "fuck you") {
      alert("" + theForm.info.value + " too!");
      theForm.info.focus();
      return (false);
   }
   return (true);
}


//EIND FORM VALIDATION CONTACT


//BEGIN POP UP ROUTE

function openWindow(uri) {
   var locatie = uri;
   window.open(locatie,'newWindow','width=400,height=340,top=100,left=100,toolbar=no,menubar=no,status=no,scrollbars=yes');
}

//EIND POP UP ROUTE



//BEGIN DATE & TIME FUNCTIE

function clock() {
if (!document.layers && !document.all) return;
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var amOrPm = "AM";
if (hours > 11) amOrPm = "PM";
if (hours > 12) hours = hours - 12;
if (hours == 0) hours = 12;
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;
var now = new Date();
var days = new Array('Zondag','Maandag','Dinsdag','Woensdag','Donderdag','Vrijdag','Zaterdag');
var months = new Array('januari','februari','maart','april','mei','juni','juli','augustus','september','oktober','november','december');
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
								}
today =  date + " " +         
		  months[now.getMonth()] + " " +
	        (fourdigits(now.getYear())) ;
dispTime = today + " - " + hours + ":" + minutes + " " + amOrPm;
if (document.layers) {
document.layers.pendule.document.write(dispTime);
document.layers.pendule.document.close();
}
else
if (document.all)
pendule.innerHTML = dispTime;
setTimeout("clock()", 1000);
}


//EIND DATE & TIME FUNCTIE



//BEGIN FORM VALIDATION AANMELDEN

function CheckAll2(theForm) {
   if (theForm.name.value == "") {
      alert("Vul a.u.b. uw naam in.");
      theForm.name.focus();
      return (false);
   }
   if ((isNaN(theForm.phone.value)) && (theForm.phone.value.length < 10)) {
      alert("Vul a.u.b. een geldig telefoonnummer in.");
      theForm.phone.focus();
      return (false);
   }
  if (theForm.from.value == "")
  {
    alert("Vult u a.u.b. uw e-mailadres in.");
    theForm.from.focus();
    return (false);
  }
  if (!isEmailAddr(theForm.from.value))
  {
    alert("Vult u a.u.b. een geldig e-mailadres in in de vorm : uwnaam@uwdomein.com");
    theForm.from.focus();
    return (false);
  }
   if (theForm.categorie.value == "") {
      alert("Selecteer a.u.b. een categorie.");
      theForm.categorie.focus();
      return (false);
   }
   if (theForm.info.value == "") {
      alert("Wat is uw boodschap?");
      theForm.info.focus();
      return (false);
   }
   if (theForm.info.value == "fuck you") {
      alert("" + theForm.info.value + " too!");
      theForm.info.focus();
      return (false);
   }
   return (true);
}


//EIND FORM VALIDATION AANMELDEN





//BEGIN FORM VALIDATION BOEK

			function CheckAll3(theForm) {
				var myRegExp = /\d/;

			   if (theForm.contact.value == "") {
				alert("Vul a.u.b. de contactpersoon in.");
			      theForm.contact.focus();
			      return (false);
			   }
			   if (isNaN(theForm.tel.value) || (theForm.tel.value.length > 10)) {
			      alert("U heeft een onjuist telefoonnummer ingevoerd.");
			      theForm.tel.focus();
			      return (false);
			   }
			   if (theForm.email.value == "") {
			      alert("U heeft uw E-mailadres niet ingevuld.");
			      theForm.email.focus();
			      return (false);
			   }
			   if (theForm.email.value.length < 1) {
			      alert("U heeft uw E-mailadres niet ingevuld.");
			      theForm.email.focus();
			      return (false);
			   }
			   if (theForm.email.value.indexOf("@",1) == -1) {
			      alert("U heeft een verkeerd E-mailadres ingevuld.");
			      theForm.email.focus();
			      return (false);
			   }
			   if (theForm.email.value.indexOf(".",theForm.email.value.indexOf("@")+1) == -1) {
			      alert("U heeft een verkeerd E-mailadres ingevuld");
			      theForm.email.focus();
			      return (false);
			   }
			   if (theForm.omschrijving.value == "") {
				alert("Wat is de omschrijving van het evenement?");
			      theForm.omschrijving.focus();
			      return (false);
			   }
			   if (theForm.promi1.value == "") {
				alert("Welke prominent wilt u aanvragen?");
			      theForm.promi1.focus();
			      return (false);
			   }
			   return (true);
			}


//EIND FORM VALIDATION BOEK
