/////////////////////////////////////////// BASIC FUNCTIONS, DON'T EDIT ///////////////////////////////////////////

/*
 * Starts executing the initializing functions when the DOM structure of the page has been loaded.
 * 
 * @author CSD (clientsidedevelopers[AT]efocus.nl)
 * @uses Mootools 1.2.1 JavaScript Library
 */
window.addEvent('domready', function() {
	initExternalLinks();
	//headerCurrentDate();
	headerSearchField();
	headerMainNavSubWidth();
	headerMainNavIE6();
	homeFocusListIE6();
	vacanciesListIE6();
	paginatorAlignment();
	calculateLightBoxDimensions();
	initPhotoSlideshow();
	loadRouteMap();
	headerVisualSlideShow();
	headerTriggerSlideShow();
	partnerSlideShow();
	photoSlideShow();
});

/*
 * Starts executing the initializing functions when the entire page has been loaded.
 * 
 * @author CSD (clientsidedevelopers[AT]efocus.nl)
 * @uses Mootools 1.2.1 JavaScript Library
 */
window.addEvent('load', function() {
	homeFocusListHeight();
});



/////////////////////////////////////////// CLIENT-SIDE JAVASCRIPT FUNCTIONS ///////////////////////////////////////////

/*
 * initExternalLinks
 * Used in order for certain links to open in a new window without the direct target attribute (so it validates properly).
 * 
 * @author CSD (clientsidedevelopers[AT]efocus.nl)
 * @uses <a href="http://www.efocus.nl/" rel="external">eFocus site</a>
 */
function initExternalLinks() {
	if (!document.getElementsByTagName) return; 
	var arrAnchors = document.getElementsByTagName("a"); 
	for (var i=0; i<arrAnchors.length; i++) { 
		var elAnchor = arrAnchors[i]; 
		if (elAnchor.getAttribute("href") && elAnchor.getAttribute("rel") == "external") {
			elAnchor.target = "_blank";
		}
	}
}



/*
 * headerCurrentDate
 * Returns the current date in Dutch visible in the header.
 * 
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 */
function headerCurrentDate() {
	if (!$('header').getElement('.date')) return;
	
	elHeader = $('header');
	elHeaderDate = elHeader.getElement('.date');
	
	objCurrentDate = new Date();
	
	var arrDayName = new Array('Zondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag');
	var arrMonthName = new Array('januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december');

	strDayName = arrDayName[objCurrentDate.getUTCDay()];
	intDayNumber = objCurrentDate.getUTCDate();
	strMonthName = arrMonthName[objCurrentDate.getUTCMonth()];
	intYearNumber = objCurrentDate.getUTCFullYear();
	
	strCurrentDate = strDayName + ', ' + intDayNumber + ' ' + strMonthName + ' ' + intYearNumber;
	
	elHeaderDate.innerHTML = strCurrentDate;
}



/*
 * headerSearchField
 * Removes the default text in the header's searchtext.
 * 
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 */
function headerSearchField() {
	var arrSearch = $$('.search');
	if (arrSearch.length == 0) return;
	
	elSearchField = arrSearch[0].getElement('.searchfield');
	elSearchFieldDefaultValue = elSearchField.value;
	
	elSearchField.addEvents({
		'focus': function(){
			elSearchField.value = '';
		},
		'blur': function(){
			if (elSearchField.value == '') {
				elSearchField.value = elSearchFieldDefaultValue;
			}
		}
	});
}


/*
 * headerMainNavSubWidth
 * Calculates the max width of a dropdown menuitem link and sets it to all subitem links.
 * 
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 */
function headerMainNavSubWidth() {
	var arrMainNavs = $$('.main_nav');
	if (arrMainNavs.length == 0) return;
	
	arrMainNavs.each(function(elMainNav){
		arrMainNavListItems = elMainNav.getChildren('li');
		arrMainNavListItems.each(function(elMainNavListItem){
			if (elMainNavListItem.getElement('ul')) {
				elMainNavLink = elMainNavListItem.getElement('a');
				elSubNav = elMainNavListItem.getElement('ul');
				arrSubNavLinks = elSubNav.getElements('a');
				intMainNavLinkWidth = elMainNavLink.getSize().x;
				intMainNavLinkPaddingLeft = elMainNavLink.getStyle('padding-left').toInt();
				intMainNavLinkPaddingRight = elMainNavLink.getStyle('padding-right').toInt();
				intSubNavLinkMinWidth = intMainNavLinkWidth - (intMainNavLinkPaddingLeft + intMainNavLinkPaddingRight);
				intSubNavLinkMaxWidth = 0;
				
				arrSubNavLinks.each(function(elSubNavLink){
					intSubNavLinkBorderLeft = elSubNavLink.getStyle('border-left-width').toInt();
					intSubNavLinkBorderRight = elSubNavLink.getStyle('border-right-width').toInt();

					intSubNavLinkWidth = elSubNavLink.getSize().x - (intSubNavLinkBorderLeft + intSubNavLinkBorderRight + intMainNavLinkPaddingLeft + intMainNavLinkPaddingRight);
					
					if (intSubNavLinkWidth >= intSubNavLinkMaxWidth) {
						intSubNavLinkMaxWidth = intSubNavLinkWidth;
					}
				});
				
				if (intSubNavLinkMaxWidth < intSubNavLinkMinWidth) {
					intSubNavLinkMaxWidth = intSubNavLinkMinWidth;
				}
				
				arrSubNavLinks.each(function(elSubNavLink){
					elSubNavLink.setStyle('width', intSubNavLinkMaxWidth);
				});
			}
		});
	});
}



/*
 * headerMainNavIE6
 * Fixes the rollover and dropdown effect of the main nav on the homepage in IE6.
 * 
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 */
function headerMainNavIE6() {
	var arrMainNavs = $$('.main_nav');
	if (!Browser.Engine.trident4 || arrMainNavs.length == 0) return;
	
	arrMainNavs.each(function(elMainNav){
		arrMainNavListItems = elMainNav.getElements('li');
		arrMainNavListItems.each(function(elMainNavListItem){
			elMainNavListItem.addEvents({
				'mouseenter': function(){
					elMainNavListItem.addClass('hover');
				},
				'mouseleave': function(){
					elMainNavListItem.removeClass('hover');
				}
			});		
		});
	});
}



/*
 * homeFocusListHeight
 * Equals the height of each list item in the focus list on the homepage.
 * 
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 */
function homeFocusListHeight() {
	var arrFocusList = $$('.focus_list');
	if (arrFocusList.length == 0) return;
	
	intFocusListItemMaxHeight = 0;
	
	arrFocusList.each(function(elFocusList){
		arrFocusListItems = elFocusList.getChildren('li');
		arrFocusListItems.each(function(elFocusListItem){
			intFocusListItemPaddingTop = elFocusListItem.getStyle('padding-top').toInt();
			intFocusListItemPaddingBottom = elFocusListItem.getStyle('padding-bottom').toInt();
			intFocusListItemHeight = elFocusListItem.getSize().y - (intFocusListItemPaddingTop + intFocusListItemPaddingBottom);
			
			if (intFocusListItemHeight >= intFocusListItemMaxHeight) {
				intFocusListItemMaxHeight = intFocusListItemHeight;
			}
		});	
		arrFocusListItems.each(function(elFocusListItem){
			elFocusListItem.setStyle('height', intFocusListItemMaxHeight);
		});	
	});	
}



/*
 * homeFocusListIE6
 * Fixes the rollover effect of the focus list on the homepage in IE6.
 * 
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 */
function homeFocusListIE6() {
	var arrFocusList = $$('.focus_list');
	if (!Browser.Engine.trident4 || arrFocusList.length == 0) return;
	
	arrFocusList.each(function(elFocusList){
		arrFocusListItems = elFocusList.getElements('li');
		arrFocusListItems.each(function(elFocusListItem){
			elFocusListItem.addEvents({
				'mouseenter': function(){
					elFocusListItem.addClass('hover');
				},
				'mouseleave': function(){
					elFocusListItem.removeClass('hover');
				}
			});		
		});
	});
}



/*
 * vacanciesListIE6
 * Fixes the rollover effect of the vacancieslist in IE6.
 * 
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 */
function vacanciesListIE6() {
	var arrVacanciesList = $$('.vacancies_list');
	if (!Browser.Engine.trident4 || arrVacanciesList.length == 0) return;
	
	arrVacanciesList.each(function(elVacanciesList){
		arrVacanciesListItems = elVacanciesList.getElements('li');
		arrVacanciesListItems.each(function(elVacanciesListItem){
			elVacanciesListItem.addEvents({
				'mouseenter': function(){
					elVacanciesListItem.addClass('hover');
				},
				'mouseleave': function(){
					elVacanciesListItem.removeClass('hover');
				}
			});		
		});
	});
}



/*
 * paginatorAlignment
 * Centers the paginator in the paginator container.
 * 
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 */
function paginatorAlignment() {
	arrPagCont = $$('.paginator_container');
	if (arrPagCont.length == 0) return;
	
	arrPagCont.each(function(elPagCont){
		var elPagContWidth = elPagCont.getSize().x;
		var elPag = elPagCont.getElement('.paginator');
		var elPagWidth = elPag.getSize().x;
		
		elPag.setStyles({
			'position': 'relative',
			'left': '48%',
			'margin-left': -(elPagWidth / 2)
		});
	});
}



/*
 * calculateLightBoxDimensions
 * Calculates the dimensions of each lightbox and adds it to the appropriate link.
 * 
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 */
function calculateLightBoxDimensions() {
	arrRefLists = $$('.references_list');
	if (arrRefLists.length == 0) return;
	
	arrRefLists.each(function(elRefList){
		arrRefListLinks = elRefList.getElements('a');
		arrRefListLinks.each(function(elRefListLink){
			strRefListLinkHref = elRefListLink.getProperty('href').replace(/#/,'');
			strRefListLinkRel = elRefListLink.getProperty('rel');
			elLightboxContent = $(strRefListLinkHref).getElement('.lightbox_content');
			elLightboxContentWidth = elLightboxContent.getSize().x;
			elLightboxContentHeight = elLightboxContent.getSize().y;
			elRefListLink.setProperty('rel', 'shadowbox;width=' + elLightboxContentWidth + ';height=' + elLightboxContentHeight);
		});
		Shadowbox.init();
	});
}



/*
 * initPhotoSlideshow
 * Loads the functionality for the photo slideshow.
 * 
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 */
function initPhotoSlideshow() {
	arrPhotoSlideshows = $$('.photo_slideshow');
	if (arrPhotoSlideshows.length == 0) return;
	
		
	
	Shadowbox.init();
}



/*
 * loadRouteMap
 * Loads a map with a custom icon using Google Maps.
 * 
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 */
function loadRouteMap() {
	if (!$('route_map')) return;
	
	var elRouteMap = $('route_map');
	var elRouteZip = $('route_zip');
	var elRouteBtn = $('route_button');
	var elRouteDir = $('route_directions');

	var strCompanyName = $('company_name').innerHTML;
	var strCompanyStreet = $('company_street').innerHTML;
	var strCompanyCity = $('company_city').innerHTML;
	var strBalloonContent = '<h4>' + strCompanyName + '</h4>' + '<p>' + strCompanyStreet + '<br />' + strCompanyCity + '</p>';
	var locale = 'nl_NL';

	if (GBrowserIsCompatible()) {
		var map = new GMap2(elRouteMap);
		var geocoder = new GClientGeocoder();
	
		var gdir = new GDirections(map, elRouteDir);
		
		var strAddress = strCompanyStreet + ', ' + strCompanyCity;

		function showAddress(address) {
			geocoder.getLatLng(
				address,
				function(point) {
					if (!point) {
						alert(address + " not found");
					} else {
						map.setCenter(point, 12);
						
						var diagoIcon = new GIcon();
						diagoIcon.image = "/siteimg/icon_diago_logo.png";
						diagoIcon.iconSize = new GSize(24, 32);
						diagoIcon.iconAnchor = new GPoint(9, 34);
						diagoIcon.infoWindowAnchor = new GPoint(7, 38);
						diagoIcon.shadow = "/siteimg/icon_diago_logo_shadow.png";
						diagoIcon.shadowSize = new GSize(40, 32);
						
						markerOptions = { icon:diagoIcon };
						var marker = new GMarker(point, markerOptions);
						
						map.addOverlay(marker);
						map.addControl(new GLargeMapControl());
						map.addControl(new GMapTypeControl());
						marker.openInfoWindowHtml(strBalloonContent);
						
						GEvent.addListener(marker, "click", function() {
							marker.openInfoWindowHtml(strBalloonContent);
						});

					}
				}
			);
		}
		
		showAddress(strAddress);
	}
	
	elRouteBtn.addEvent('click', function(){
	  	strRouteZip = elRouteZip.value;
		gdir.load('from: ' + strRouteZip + ' to: ' + strAddress, { 'locale': locale });
	});
	
	elRouteZip.addEvent('keydown', function(event){
		if (event.key == 'enter') {
	  		strRouteZip = elRouteZip.value;
			gdir.load('from: ' + strRouteZip + ' to: ' + strAddress, { 'locale': locale });
		}
	});
}



/**
 * EfxBaseSlideShow Class
 * Reusable slideshow class.
 *
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 * @param arrSlides, intStartSlide, blnLoop, intInterval, blnAutoPlay, blnPlaying
 * @param strOutEffectProperty, intOutEffectStartValue, intOutEffectEndValue, intOutEffectDuration
 * @param strInEffectProperty, intInEffectStartValue, intInEffectEndValue, intInEffectDuration
 * @return EfxBaseSlideShow
 */
var EfxBaseSlideShow = new Class({
	Implements: [Options, Events, Chain],
	options: {
		arrSlides: [],
		intStartSlide: 0,
		blnLoop: true,
		intInterval: 2500,
		blnAutoPlay: true,
		blnPlaying: false,
		
		strOutEffectProperty: 'opacity',
		intOutEffectStartValue: 1,
		intOutEffectEndValue: 0,
		intOutEffectDuration: 'long',
		
		strInEffectProperty: 'opacity',
		intInEffectStartValue: 0,
		intInEffectEndValue: 1,
		intInEffectDuration: 'long'
	},
	initialize: function(options) {
		this.setOptions(options);
		this.addSlides(this.options.arrSlides);
		this.options.arrSlides.each(function(slide){
//			slide.setOpacity(0);
			slide.setStyle('visibility', 'hidden');
		});
		this.showSlide(this.options.intStartSlide);
		if (this.options.blnAutoPlay == true && this.options.blnPlaying == false) {
			this.playSlideShow();
		}
		this.intSlideCount = 0;
	},
	arrSlideCollection: [],
	addSlides: function(arrSlides){
		arrSlides.each(function(slide){
			this.arrSlideCollection.include(slide);
		}, this);
	},
	addSlide: function(slide){
		this.addSlides($splat(slide));
	},
	cycleForwards: function(){
		if ($chk(this.intCurrentSlideNumber) && this.intCurrentSlideNumber < this.arrSlideCollection.length-1) {
			this.showSlide(this.intCurrentSlideNumber+1);
		} else if ((this.intCurrentSlideNumber) && this.options.blnLoop) {
			this.showSlide(0);
		} else if (!defined(this.intCurrentSlideNumber)) {
			this.showSlide(this.options.intStartSlide);
		}
	},
	cycleBackwards: function(){
		if (this.intCurrentSlideNumber > 0) {
			this.showSlide(this.intCurrentSlideNumber-1);
		} else if (this.options.blnLoop) {
			this.showSlide(this.arrSlideCollection.length-1);
		}
	},
	showSlide: function(intSlideNumberToShow){
		if (this.arrSlideCollection[intSlideNumberToShow]) {
			var that = this;
			
			strOutEffectProperty = that.options.strOutEffectProperty;
			intOutEffectStartValue = that.options.intOutEffectStartValue;
			intOutEffectEndValue = that.options.intOutEffectEndValue;
			intOutEffectDuration = that.options.intOutEffectDuration;
			
			strInEffectProperty = that.options.strInEffectProperty;
			intInEffectStartValue = that.options.intInEffectStartValue;
			intInEffectEndValue = that.options.intInEffectEndValue;
			intInEffectDuration = that.options.intInEffectDuration;
			
			// Transition Out (old slide)
			if (this.arrSlideCollection[this.intCurrentSlideNumber]) {
				var intPreviousSlideNumber = this.intCurrentSlideNumber;
				if (strInEffectProperty != strOutEffectProperty) {
					this.arrSlideCollection[intSlideNumberToShow].setStyle(strOutEffectProperty, intOutEffectStartValue);
				}
				
				this.arrSlideCollection[this.intCurrentSlideNumber].get('tween', {property: strOutEffectProperty, duration: intOutEffectDuration}).start(intOutEffectStartValue, intOutEffectEndValue).chain(function(){
					that.arrSlideCollection[intPreviousSlideNumber].setStyle(strInEffectProperty, intInEffectStartValue);
				});
			}
			// Transition In (new slide)
			this.arrSlideCollection[intSlideNumberToShow].get('tween', {property: strInEffectProperty, duration: intInEffectDuration}).start(intInEffectStartValue, intInEffectEndValue);
			
			this.intCurrentSlideNumber = intSlideNumberToShow;
		}
		this.fireEvent('slideShown', this);
	},
	runSlideShow: function(){
		var that = this;
		
		if (that.intCurrentSlideNumber != this.intSlideCount) {
			this.intSlideCount = that.intCurrentSlideNumber;
		}
		this.intSlideCount++;
		if (this.intSlideCount >= that.arrSlideCollection.length) {
			this.intSlideCount = 0;
		}			
		this.showSlide(this.intSlideCount);
	},
	playSlideShow: function(){
		this.options.blnPlaying = true;
		this.slideShowTimer = this.runSlideShow.periodical(this.options.intInterval, this);
	},
	name: 'EfxBaseSlideShow'
});



/**
 * EfxNavSlideShow Class
 * Customized slideshow class.
 *
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 * @param elNav, strLabelPrev, strLabelNext, strLabelFirst, strLabelLast, strLabelPlay, strLabelPause
 * @return EfxNavSlideShow
 */
var EfxNavSlideShow = new Class({
	Extends: EfxBaseSlideShow,
	options: {
		elNav: $('slideshow_nav'),
		strLabelPrev: 'Previous',
		strLabelNext: 'Next',
		strLabelFirst: 'First',
		strLabelLast: 'Last',
		strLabelPlay: 'Play',
		strLabelPause: 'Pause'
	},
	initialize: function(options){
		this.parent(options);
		if ($defined(this.options.elNav)) {
			this.arrNavLinkNumbers = [];
			this.populateNav();
			this.arrNavListItems = this.options.elNav.getElements('li');
			this.intNavLinksNotNumbers = 0;
			this.arrNavLinks = this.options.elNav.getElements('a');
			this.initNav();
			if (this.arrNavLinkNumbers.length != 0) {
				this.activateNavLink(this.arrNavLinkNumbers[this.options.intStartSlide]);
			}
			this.addEvent('slideShown', function(){
				if (this.arrNavLinkNumbers.length != 0) {
					this.activateNavLink(this.arrNavLinkNumbers[this.intCurrentSlideNumber]);
				}
			});
		}
	},
	populateNav: function(){
		var that = this;
		var elNavListItemNumber = null;
		this.options.elNav.getElements('li').each(function(elNavListItem, n){
			switch(elNavListItem.getElement('a').className){
				case 'prev': break;
				case 'next': break;
				case 'first': break;
				case 'last': break;
				case 'play': break;
				case 'pause': break;
				default: elNavListItemNumber = elNavListItem;
			};
		});
		
		if ($chk(elNavListItemNumber)) {
			this.arrSlideCollection.each(function(elSlide, n){
				elNavListItemNumberNew = elNavListItemNumber.clone();
				elNavListItemNumberNew.getElement('a').innerHTML = n+1;
				elNavListItemNumberNew.getElement('a').setProperty('title', n+1);
				elNavListItemNumberNew.injectBefore(elNavListItemNumber);
				that.arrNavLinkNumbers.include(elNavListItemNumberNew.getElement('a'));
			});
			elNavListItemNumber.dispose();
		}
	},
	initNav: function(){
		var that = this;
		this.arrNavLinks.each(function(elNavLink, n){
			switch(elNavLink.className){
				case 'pause':
					if (that.options.blnPlaying != true) {
						var strNavLinkLabel = that.options.strLabelPlay;
					} else {
						var strNavLinkLabel = that.options.strLabelPause;
					}
					elNavLink.innerHTML = strNavLinkLabel;
					elNavLink.setProperty('title', strNavLinkLabel);
					elNavLink.toggleClass('play');
					elNavLink.toggleClass('pause');
					
					elNavLink.addEvent('click', function(){
						if ($chk(that.slideShowTimer)) {
							var strNavLinkLabel = that.options.strLabelPlay;
							that.slideShowTimer = $clear(that.slideShowTimer);
						} else {
							var strNavLinkLabel = that.options.strLabelPause;
							that.playSlideShow();
						}
						elNavLink.innerHTML = strNavLinkLabel;
						elNavLink.setProperty('title', strNavLinkLabel);
						elNavLink.toggleClass('play');
						elNavLink.toggleClass('pause');
					});
					that.intNavLinksNotNumbers++;
					break;
				case 'play':
					if (that.options.blnPlaying != true) {
						var strNavLinkLabel = that.options.strLabelPlay;
					} else {
						var strNavLinkLabel = that.options.strLabelPause;
					}
					elNavLink.innerHTML = strNavLinkLabel;
					elNavLink.setProperty('title', strNavLinkLabel);
					elNavLink.toggleClass('play');
					elNavLink.toggleClass('pause');
					
					elNavLink.addEvent('click', function(){
						if ($chk(that.slideShowTimer)) {
							var strNavLinkLabel = that.options.strLabelPlay;
							that.slideShowTimer = $clear(that.slideShowTimer);
						} else {
							var strNavLinkLabel = that.options.strLabelPause;
							that.playSlideShow();
						}
						elNavLink.innerHTML = strNavLinkLabel;
						elNavLink.setProperty('title', strNavLinkLabel);
						elNavLink.toggleClass('play');
						elNavLink.toggleClass('pause');
					});
					that.intNavLinksNotNumbers++;
					break;
				case 'first': 
					if (!elNavLink.innerHTML) elNavLink.innerHTML = that.options.strLabelFirst;
					if (!elNavLink.getProperty('title')) elNavLink.setProperty('title', that.options.strLabelFirst);
					elNavLink.addEvent('click', function(){
						that.intSlideCount = 0;
						that.showSlide(that.intSlideCount);
					});
					that.intNavLinksNotNumbers++;
					break;
				case 'prev': 
					if (!elNavLink.innerHTML) elNavLink.innerHTML = that.options.strLabelPrev;
					if (!elNavLink.getProperty('title')) elNavLink.setProperty('title', that.options.strLabelPrev);
					elNavLink.addEvent('click', function(){
						that.cycleBackwards();
					});
					that.intNavLinksNotNumbers++;
					break;
				case 'next': 
					if (!elNavLink.innerHTML) elNavLink.innerHTML = that.options.strLabelNext;
					if (!elNavLink.getProperty('title')) elNavLink.setProperty('title', that.options.strLabelNext);
					elNavLink.addEvent('click', function(){
						that.cycleForwards();
					});
					that.intNavLinksNotNumbers++;
					break;
				case 'last': 
					if (!elNavLink.innerHTML) elNavLink.innerHTML = that.options.strLabelLast;
					if (!elNavLink.getProperty('title')) elNavLink.setProperty('title', that.options.strLabelLast);
					elNavLink.addEvent('click', function(){
						that.intSlideCount = that.arrSlideCollection.length-1;
						that.showSlide(that.intSlideCount);
					});
					that.intNavLinksNotNumbers++;
					break;
				default:
					var intNavLinksOffset = that.intNavLinksNotNumbers;
					elNavLink.addEvent('click', function(){
						that.intSlideCount = n-intNavLinksOffset;
						that.showSlide(that.intSlideCount);
						that.activateNavLink(elNavLink);
					});
			};
		});
	},
	activateNavLink: function(elNavLink){
		this.arrNavListItems.each(function(elNavListItem){
			elNavListItem.removeClass('active');
		});
		elNavLink.getParent().addClass('active');
	},
	name: 'EfxNavSlideShow'
});



/**
 * headerVisualSlideShow
 * Animates the visual in the header as a slideshow.
 *
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 * @param arrSlides, intStartSlide, blnLoop, intInterval, blnAutoPlay, blnPlaying
 * @param strOutEffectProperty, intOutEffectStartValue, intOutEffectEndValue, intOutEffectDuration
 * @param strInEffectProperty, intInEffectStartValue, intInEffectEndValue, intInEffectDuration
 * @return EfxBaseSlideShow Class instance
 */
function headerVisualSlideShow(){
	if (!$('header_visual_slideshow')) return;
	
	var elSs = $('header_visual_slideshow');
	var arrMySlides = elSs.getElements('.slide');
	
	var objSlideShow = new EfxBaseSlideShow({
		arrSlides: arrMySlides,
		intInterval: 5500,
		intOutEffectDuration: 2000,
		intInEffectDuration: 2000
	});
}



/**
 * headerTriggerSlideShow
 * Animates the slideshow on the homepage.
 *
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 * @param arrSlides, intStartSlide, blnLoop, intInterval, blnAutoPlay, blnPlaying
 * @param strOutEffectProperty, intOutEffectStartValue, intOutEffectEndValue, intOutEffectDuration
 * @param strInEffectProperty, intInEffectStartValue, intInEffectEndValue, intInEffectDuration
 * @return EfxBaseSlideShow Class instance
 */
function headerTriggerSlideShow(){
	if (!$('header_slideshow')) return;
	
	var elSs = $('header_slideshow');
	var arrMySlides = elSs.getElements('.slide');

	var objSlideShow = new EfxBaseSlideShow({
		arrSlides: arrMySlides,
		intInterval: 3000
	});
}



/**
 * partnerSlideShow
 * Animates the slideshow with partner logo's in the alsosee-block.
 *
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 * @param arrSlides, intStartSlide, blnLoop, intInterval, blnAutoPlay, blnPlaying
 * @param strOutEffectProperty, intOutEffectStartValue, intOutEffectEndValue, intOutEffectDuration
 * @param strInEffectProperty, intInEffectStartValue, intInEffectEndValue, intInEffectDuration
 * @return EfxBaseSlideShow Class instance
 */
function partnerSlideShow(){
	arrPartnerSlideShows = $$('.partner_slideshow');
	if (arrPartnerSlideShows.length == 0) return;
	
	var elSs = arrPartnerSlideShows[0];
	var arrMySlides = elSs.getElements('.slide');
	
	var objSlideShow = new EfxBaseSlideShow({
		arrSlides: arrMySlides,
		intInterval: 2500
		
/*
		strOutEffectProperty: 'left',
		intOutEffectStartValue: 0,
		intOutEffectEndValue: -300,
		intOutEffectDuration: 'short',
		
		strInEffectProperty: 'left',
		intInEffectStartValue: 300,
		intInEffectEndValue: 0,
		intInEffectDuration: 'short'
*/
	});
}



/**
 * photoSlideShow
 * Animates the interactive photo slideshow in the alsosee block.
 *
 * @author Ralph Meeuws (ralph-meeuws[AT]efocus.nl)
 * @param arrSlides, intStartSlide, blnLoop, intInterval, blnAutoPlay, blnPlaying
 * @param strOutEffectProperty, intOutEffectStartValue, intOutEffectEndValue, intOutEffectDuration
 * @param strInEffectProperty, intInEffectStartValue, intInEffectEndValue, intInEffectDuration
 * @param elNav, strLabelPrev, strLabelNext, strLabelFirst, strLabelLast, strLabelPlay, strLabelPause
 * @return EfxNavSlideShow Class instance
 */
function photoSlideShow(){
	arrPhotoSlideShows = $$('.photo_slideshow');
	if (arrPhotoSlideShows.length == 0) return;
	
	var elSs = arrPhotoSlideShows[0];
	var arrMySlides = elSs.getElements('.slide');
	var elMyNav = arrPhotoSlideShows[0].getElement('.slideshow_nav');

	var arrMyNavLinks = elMyNav.getElements('a');
	arrMyNavLinks.addEvent('focus', function(){this.blur()});
	
	var objSlideShow = new EfxNavSlideShow({
		arrSlides: arrMySlides,
		intInterval: 4000,
		elNav: elMyNav,
		strLabelPlay: 'Afspelen',
		strLabelPause: 'Pauzeren'
	});
}


/////////////////////////////////////////// SERVER-SIDE JAVASCRIPT FUNCTIONS ///////////////////////////////////////////

