
$(document).ready(function() {
	
	
	//tabs homepage 

	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
		


	// sitemap onder aan de pagina 
	
	$('div.sitemapbutton').bind('click', function(evt) {	
		evt.preventDefault();	
		$('.sitemap').slideToggle(500);	
		$(this).toggleClass('open');	
	});
	
	
	
	//zoekveld leegmaken on focus

	(function ($) {
	
		$.fn.hint = function (blurClass) {
		  if (!blurClass) { 
			blurClass = 'blur';
		  }
			
		  return this.each(function () {
			// get jQuery version of 'this'
			var $input = $(this),
			
			// capture the rest of the variable to allow for reuse
			  title = $input.attr('title'),
			  $form = $(this.form),
			  $win = $(window);
		
			function remove() {
			  if ($input.val() === title && $input.hasClass(blurClass)) {
				$input.val('').removeClass(blurClass);
			  }
			}
		
			// only apply logic if the element has the attribute
			if (title) { 
			  // on blur, set value to title attr if text is blank
			  $input.blur(function () {
				if (this.value === '') {
				  $input.val(title).addClass(blurClass);
				}
			  }).focus(remove).blur(); // now change all inputs to title
			  
			  // clear the pre-defined text when form is submitted
			  $form.submit(remove);
			  $win.unload(remove); // handles Firefox's autocomplete
			}
		  });
		};
	
	})(jQuery);
	
	
	$(function(){ 
		// find all the input elements with title attributes
		$('input[title!=""]').hint();
	});	


	
	
})



