			$(function() {

				//set the panes to default
				$('#flowpanesGamma').hide();
				$('#flowpanes').show();

				//set the page title to default
				document.title = 'Huylebrouck NV - Home';

				//when clicked on the logo
				$('h1').click(function(){
					$('#menubar ul li a:first').trigger('click');
				});
				
				//when clicked on the menubar links
				$('#menubar ul li a').click(function() {

					//set page title
					switch($(this).attr('href')){
						case '#home': document.title = 'Huylebrouck NV - Home';break;
						case '#gamma': document.title = 'Huylebrouck NV - Ons gamma';break;
						case '#geschiedenis': document.title = 'Huylebrouck NV - Geschiedenis';break;
						case '#contact': document.title = 'Huylebrouck NV - Contact';break;
					}


				  	$('#flowpanesGamma').hide(1000);
				  	$('#flowpanes').show(1000);

				  	RemoveAllCurrents();
				});

				//when clicked on the sidelinks
				$('#sideLinks li a').click(function() {

					$('#flowpanes').hide(1000);
					$('#flowpanesGamma').show(1000);


					RemoveAllActives();
					SetGammaActive();

					document.title = 'Huylebrouck NV - Ons gamma'

				});

				//when clicked on the 'gamma'-doors/links on the 'ons gamma' page
				$('.gammaDetail li a').click(function(){

					$('#flowpanes').hide(1000);
					$('#flowpanesGamma').show(1000);

					//find out which one is clicked
					var temp = $(this).attr('href');

					//loop every one on the sideLinks
					$('#sideLinks li a').each(function(){

						//get their name
						var temp2 = $(this).attr('href');

						//if mached
						if($(this).attr('href') == temp){

							//trigger the click on that link
							$(this).trigger('click');
						}
					});

					document.title = 'Huylebrouck NV - Ons gamma'
				});

				//functions for correcting the active/current links

					function SetGammaActive(){
						//add the class 'active' to gamma
						$('#menubar #t2').addClass('active');
					}

					function RemoveAllActives(){
						//remove the 'active' class from menubar
						$('#menubar ul li a').each(function(){
							$(this).removeClass('active');
						});
					}

					function RemoveAllCurrents(){
						//remove the 'current' class from sideLinks
						$('#sideLinks li a').each(function(){
							$(this).removeClass('current');
						});
					}

				//functions to set the flowpanes

					// select #flowplanes and make it scrollable. use circular and navigator plugins
					$("#flowpanes").scrollable({ circular: true, mousewheel: false }).navigator({

						// select #flowtabs to be used as navigator
						navi: "#menubar",

						// select A tags inside the navigator to work as items (not direct children)
						naviItem: 'a',

						// assign "current" class name for the active A tag inside navigator
						activeClass: 'active',

						// make browser's back button work
						history: true

					});


					// select #flowplanesGamma and make it scrollable. use circular and navigator plugins
					$("#flowpanesGamma").scrollable({ vertical:true, circular:false, mousewheel: true }).navigator({

						// select #flowtabs to be used as navigator
						navi: "#sideLinks",

						// select A tags inside the navigator to work as items (not direct children)
						naviItem: 'a',

						// assign "current" class name for the active A tag inside navigator
						activeClass: 'current',

						// make browser's back button work
						history: true

					});

				//set fancybox
				$("a.fancybox").fancybox({
						'transitionIn' : 'elastic',
						'transitionOut' : 'elastic',
						'speedIn' : 600,
						'speedOut' : 200,
						'overlayShow' : false
				});
			});


