// Alle instellingen en functies voor de kaart. 
	
	//Functie maphilight
	
				$(function() {		
				$('.hilight').maphilight()
				});

	//Instellingen Maphilight			
				
				$.fn.maphilight.defaults = {
				fill: true,
				fillColor: 'e3f2ff',
				fillOpacity: 0.4,
				stroke: true,
				strokeColor: 'ffffff',
				strokeOpacity: 1,
				strokeWidth: 3,
				fade: false,
				alwaysOn: false,
				neverOn: false,
				groupBy: false}

	//Content wisselaar	
	
				$(function(){
				
						function contentSwitcher(settings){
							var settings = {
							   contentClass : '.content',
							   lijst : '#lijst'
							};
							
							//hide the content panels and show the correct one
							$(settings.lijst).find('a').click(function(e){
								var contentToShow = $(this).attr('href');
								contentToShow = $(contentToShow);
					 
								//dissable normal link behaviour
								e.preventDefault();
					 
								//map vernieuwen
								$(settings.contentClass).css({zIndex:10}).fadeOut(200);
							   // de zIndex moet lager zijn om te zorgen dat de fade effecten in IE8 werken. 
								$(contentToShow).css({zIndex:5}).delay(250).fadeIn(200);
							});
						}
					contentSwitcher();
				});
		
	// Eztip
	
				$(document).ready(function() {
					$('.tip').eztip('area', {contentAttrs: ['alt'], opacity: 1}); //Koppeling voor alle objecten met de 'area'-tag binnen de 'map'-tag. De 'alt'-tag wordt weergegeven. 
				});  
					
// Slideshow.js

function processSlideshow(elem, imageList, imageDuration, fadeSpeed, current) 
{
	var listSize = imageList.length;
    if (!current || current >= listSize) current = 0;
    if (!imageDuration) imageDuration = 2000;
    if (!fadeSpeed) fadeSpeed = 1000;
    $(elem + " img").attr("src", imageList[current]);
    if (current == (listSize - 1)) { $(elem).css("background", "transparent url(" + imageList[0] + ") no-repeat");
    } else {
        $(elem).css("background", "transparent url(" + imageList[current + 1] + ") no-repeat");
    }
    $(elem + " img").animate({ opacity: "1" }, imageDuration).
	      animate({ opacity: "0.01" }, fadeSpeed, function() 
		   { 
		     $(this).css("opacity", "1"); processSlideshow(elem, imageList, imageDuration, fadeSpeed, current + 1) 
			});

} 

/*
CSS Browser Selector v0.4.0 (Nov 02, 2010)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);					

//eztip

;(function($) {
$.fn.eztip = function(selector, options) {
  var opts = $.extend({}, $.fn.eztip.defaults, options);

  var $vsTip = $('<div class="simple-tip"></div>')
    .css('opacity', opts.opacity)
    .hide()
    .appendTo('body');

  var tgt,
  tip = {
    link: function(e) {
      var t = $(e.target).is(selector) && e.target || $(e.target).parents(selector)[0] || false;
      return t;
    }
  };

  return this.each(function() {
    var $this = $(this),
    tipContents = '';
    var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

    $this.mouseover(function(event) {
     if (tip.link(event)) {
       tgt = tip.link(event);
       $this.data('title', tgt.title);
       o.contents = [];
       for (i=0,j = o.contentAttrs.length;i<j;i++) {
         o.contents.push(tgt[o.contentAttrs[i]]);
       }
       tgt.title = '';

       $vsTip.css({
         left: event.pageX + o.xOffset,
         top: event.pageY + o.yOffset
       }).html(o.contents.join(o.glue)).show();
     }
    }).mouseout(function(event) {
      if (tip.link(event)) {
        tgt = tip.link(event);
        tgt.title = $this.data('title');
        $vsTip.hide();
      }
    }).mousemove(function(event) {
      if (tip.link(event)) {
        $vsTip.css({
          left: event.pageX + o.xOffset,
          top: event.pageY + o.yOffset
        });
      }        
    });

  });

};

// default options
$.fn.eztip.defaults = {
  opacity: 1,
  xOffset: 10,
  yOffset: 20,
  contentAttrs: ['title'],
  glue: '<br>'
};

})(jQuery);
