﻿jQuery(function ($) {
	
	// Navigatie functies
	$(function() {
		$('ul.nav a').bind('click',function(event){
			var $anchor = $(this);
			/*
			if you want to use one of the easing effects:
			$('html, body').stop().animate({
				scrollLeft: $($anchor.attr('href')).offset().left
			}, 1500,'easeInOutExpo');
			 */
			$('html, body').stop().animate({
				scrollLeft: $($anchor.attr('href')).offset().left
			}, 1000);
			event.preventDefault();
		});
	});	

	// Accordion Function
	$(function() { 
 
	$("#accordion").tabs("#accordion div.pane", {tabs: 'h2', effect: 'slide', initialIndex: null});
	});
	
	// execute your scripts when the DOM is ready. this is mostly a good habit
	$(function() {
		// initialize scrollable
		$(".scrollable").scrollable();
	});

	// Popup Bedrijven
	$('.bedrijf .info-popup').click(function (e) {
		$('#bedrijven-popup').modal();
		return false;
	});

	// Popup Informatie
	$('.info .info-popup').click(function (e) {
		$('#informatie-popup').modal();
		return false;
	});
	
	// Popup Forenzen
	$('.forenzen .info-popup').click(function (e) {
		$('#forenzen-popup').modal();
		return false;
	});
	
	// Popup Reclame
	$('.reclame .info-popup').click(function (e) {
		$('#reclame-popup').modal();
		return false;
	});

	// Automatisch Popup Blok
	//$("#info-popup img").tooltip({ effect: 'slide'});
	
	// Tabs Activeren
	// perform JavaScript after the document is scriptable.
	$(function() {
	// setup ul.tabs to work as tabs for each div directly under div.panes
	$("ul.tabs").tabs("div.panes > div");
	});
	
	// add new effect to the tabs
	$.tools.tabs.addEffect("slide", function(i, done) {
 
	// 1. upon hiding, the active pane has a ruby background color
	this.getPanes().slideUp().css({backgroundColor: "#FF5E99"});
 
	// 2. after a pane is revealed, its background is set to its original color (transparent)
	this.getPanes().eq(i).slideDown(function()  {
		$(this).css({backgroundColor: '#666'});
 
		// the supplied callback must be called after the effect has finished its job
		done.call();
	});
});

});

