// Functie voor werking van het topmenu
function ShowMenu(action,id){
  
  if(action=='show'){
   if(document.getElementById('button1').className == 'button_active'){}else{document.getElementById('button1').className='button'; }
   if(document.getElementById('button2').className == 'button_active'){}else{document.getElementById('button2').className='button'; }
   if(document.getElementById('button3').className == 'button_active'){}else{document.getElementById('button3').className='button'; }
   if(document.getElementById(''+id+'').className == 'button_active'){}else{document.getElementById(''+id+'').className='button_hover';}
   document.getElementById('sub'+id+'').className='show';
  } else {
   if(document.getElementById('button1').className == 'button_active'){}else{document.getElementById('button1').className='button';}
   if(document.getElementById('button2').className == 'button_active'){}else{document.getElementById('button2').className='button';}
  if(document.getElementById('button3').className == 'button_active'){}else{ document.getElementById('button3').className='button';}
   document.getElementById('sub'+id+'').className='hide';
  }

}

function SubMenuHover(id){
   document.getElementById('subbutton1').className='';
}

function initRequest() {
    var request;
	if (window.ActiveXObject) {
		request = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		request = new XMLHttpRequest();
	}
    return request;
}

function ShowAlbumPic(id){

var ajaxRequest_pic = initRequest();

var rand2 = Math.random();
   
   ajaxRequest_pic.open('GET', 'components/harmonietilburg.showphoto.php?ajax=1&picid='+id+'&rand='+rand2+'');
   ajaxRequest_pic.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest_pic.onreadystatechange = function() {
   if (ajaxRequest_pic.readyState == 4) {
	document.getElementById("photoframe").innerHTML = ajaxRequest_pic.responseText;
   }
	}
    ajaxRequest_pic.send(null);

document.getElementById('photoframe').className='show';
document.getElementById('transbackground').className='show';
window.location='#top';
}

function HideAlbumPic(){
document.getElementById('photoframe').className='hide';	
document.getElementById('transbackground').className='hide';
GetRequest('components/harmonietilburg.showphoto.php?ajax=1&picid=', 'photoframe');
}

function SwitchPhoto(id){

var SwitchReq = initRequest();

var rand2 = Math.random();
   
   SwitchReq.open('GET', 'components/harmonietilburg.load.photo.horeca.php?ajax=1&photo='+id+'&rand='+rand2+'');
   SwitchReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   SwitchReq.onreadystatechange = function() {
   if (SwitchReq.readyState == 4) {
	document.getElementById("loadphotos").innerHTML = SwitchReq.responseText;
   }
	}
    SwitchReq.send(null);

}


function PreLoadImages(){

if (document.images)
{
  pic1= new Image(462,235); 
  pic1.src="images/harmonietilburg.horeca.1.jpg"; 

  pic2= new Image(462,235); 
  pic2.src="images/harmonietilburg.horeca.2.jpg"; 

  pic3= new Image(462,235); 
  pic3.src="images/harmonietilburg.horeca.3.jpg"; 
  
  pic4= new Image(462,235); 
  pic4.src="images/harmonietilburg.horeca.4.jpg"; 
  
  pic5= new Image(462,235); 
  pic5.src="images/harmonietilburg.horeca.5.jpg"; 
  
  pic6= new Image(462,235); 
  pic6.src="images/harmonietilburg.horeca.6.jpg"; 
  
  pic7= new Image(462,235); 
  pic7.src="images/harmonietilburg.horeca.7.jpg"; 
  
  pic8= new Image(462,235); 
  pic8.src="images/harmonietilburg.horeca.8.jpg"; 
  
  pic9= new Image(462,235); 
  pic9.src="images/harmonietilburg.horeca.9.jpg"; 
  
  pic10= new Image(462,235); 
  pic10.src="images/harmonietilburg.horeca.10.jpg"; 
  
  pic11= new Image(462,235); 
  pic11.src="images/harmonietilburg.horeca.11.jpg"; 
  
  pic12= new Image(462,235); 
  pic12.src="images/harmonietilburg.horeca.12.jpg"; 

  pic13= new Image(462,235); 
  pic13.src="images/harmonietilburg.horeca.13.jpg"; 
  
  pic14= new Image(462,235); 
  pic14.src="images/harmonietilburg.horeca.14.jpg"; 
  
  pic15= new Image(462,235); 
  pic15.src="images/harmonietilburg.horeca.15.jpg"; 
 
}

}

function ShowGoogleMap(){
 //document.getElementById('transbackground').className='show';
 document.getElementById('googlemap').className='show';
 window.location='#top';
}

function HideGoogleMap(){
 //document.getElementById('transbackground').className='hide';
 document.getElementById('googlemap').className='hide';
}