$(document).ready(function() {
													 
    
		/**************************************************
			NAVIGATION
		**************************************************/
		
    $("#main-navigatie .multilevel").mouseover(function() {
        $(this).addClass("hovering");        
        $("html").css({"overflow-x":"hidden"});
    });
    
    $("#main-navigatie .multilevel").mouseout(function() {
        $(this).removeClass("hovering");
    });  
		
		/**************************************************
			HOMEPAGE SLIDER
		**************************************************/
			
			$("div.scrollable").scrollable({
				loop: true,
				nextPage: ".nextPage",
				prevPage: ".prevPage",
				size: 3
			}).autoscroll({
				autoplay: true,
				interval: 3000
			});
		
		/**************************************************
			TOGGLE FAQ'S | FAQ PAGE
		**************************************************/
		
		$('.answer').hide();
		$('.faq > li a.question').click(function() {
			$(this).toggleClass("opened");
			var id = $(this).attr('id');
			$('#answer' + id).toggleFade({ speedIn : 800, speedOut : 150 });
						// alert(id);
			return false;
		});
		
		/**************************************************
			GOOGLE MAPS
		**************************************************/
		
		var googleMaps = $("#map").size();
		if (googleMaps) {
			$("#map").gMap({ 
				scrollwheel: true,
				markers: [
					{ latitude: 51.43056788340429,
						longitude:  5.471019744873047,
						html: "<strong>Vestiging Jan van Boendalelaan</strong><p>Jan van Boendalelaan 1<br>5615 KD Eindhoven<br>Telefoon: 040-2520942</p>"},
					{ latitude: 51.44001850177746,
						longitude: 5.471212863922119,
						html: "<strong>Vestiging Lichtstraat</strong><p>Fysiotherapie Gestel, locatie Lichtstraat<br>Lichtstraat 376<br>5611 XH Eindhoven<br>Telefoon: 040-2375496<br>Telefoon: 040-2520942</p>"},
					{ latitude: 51.433036067911075,
						longitude: 5.482499599456787,
						html: "<strong>Vestiging Jan Smitzlaan </strong><p>Jan Smitzlaan 7<br>5611 LD Eindhoven<br>Telefoon: 040-2114033<br>Telefoon: 040-2520942</p>"},
					{ latitude: 51.65003397266334,
						longitude: 5.62375545501709,
						html: "<strong>Vestiging Handencentrum.eu</strong><p>Velmolenweg 169<br>5404 LC Uden<br>Telefoon: 0413-271200<br>Telefoon: 040-2520942</p>"},
					{ latitude: 51.45791113082949,
						longitude: 5.471019744873047,
						html: "<strong>Vestiging Handencentrum.eu</strong><p>Dr. Cuyperslaan 53<br>5622 MA Eindhoven<br>Telefoon: 040-2366446<br>Fax: 040-2136380</p>"}],
				latitude: 51.558289817660665,
				longitude: 5.56182861328125,
				zoom: 10
			});
		}
		
		/**************************************************
			FORMS VALIDATION
		**************************************************/
		
		var quickContact = $("#quick-contact").size();
		if (quickContact) {
			$("#quick-contact").validate({
			rules: {
				Naam: "required",
				Email: { 
					required: true,
					email: true
				},
				Telefoonnummer: {
					required: true,
					number: true,
					maxlength: 10
				},
				Bericht: "required"
			},
			messages: {
				Naam: "Vul alstublieft uw naam in",
				Email: {
					required: "Vul alstublief een e-mailadres in",
					email: "Vul alstublieft een geldig e-mailadres in"
				},
				Telefoonnummer: {
					required: "Vul alstublieft uw telefoonnummer in",
					number: "U kunt alleen cijfers invullen",
					maxlength: "Uw telefoonnummer kan uit max. 10 cijfers bestaan"
				},
				Bericht: "Vul alstublieft uw bericht in"
			}
		});
	}
	
		/**************************************************
			FORMS VALIDATION
		**************************************************/
		
		var inschrijfformulier = $("#inschrijf-form").size();
		if (inschrijfformulier) {
			$("#inschrijf-form").validate({
			rules: {
				voornaam: "required",
				achternaam: "required",
				voorletters: "required",
				geslacht: "required",
				adres: "required",
				postcode_woonplaats: "required",
				geboortedatum: "required",
				emailadres: { 
					required: true,
					email: true
				},
				klacht: "required"
			},
			messages: {
				voornaam: "Vul alstublieft uw voornaam in",
				achternaam: "Vul alstublieft uw achternaam in",
				voorletters: "Vul alstublief uw voorletters in",
				geslacht: "Selecteer alstublieft uw geslacht",
				adres: "Vul alstublieft uw adres in",
				postcode_woonplaats: "Vul alstublieft uw postcode &amp; woonplaats in",
				geboortedatum: "Vul alstublieft uw geboortedatum in",
				emailadres: {
					required: "Vul alstublief uw e-mailadres in",
					email: "Vul alstublieft een geldig e-mailadres in"
				},
				klacht: "Vul alstublieft een korte omschrijving van uw klacht in"
			}
		});
	}
				
});
