	$(document).ready(function() {
				
	$(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
	
	$('#s1').cycle({	fx: 'fade', speed: 2000, delay: 2000});
	
	$('table.sortable tbody tr:odd').addClass('odd');
		
/*validate*/

				$("#reserveringsform").validate();
				
				$("#mijnGegevens").validate();


				$("#contactForm").validate({
					rules: {
						Naam: {
							required: true,
						},
						Telefoon: {
							required: true,
							number: true,
							minlength: 6
						},
						Email: {
							required: true,
							email: true
						},
					},
					messages: {
						Naam: {
							required: 'Verplicht!',
						},
						Telefoon: {
							required: 'Verplicht!',
							number: 'Onuist',
							minlength: 'Minimum lengte: 6'
						},
						Email: 'Onjuist',
						message: {
							required: 'Verplicht!'
						}
					},
						success: function(label) {
							label.html('OK').removeClass('error').addClass('ok');
							setTimeout(function(){
								label.fadeOut(500);
							}, 2000)
					}
				});
				
				/**/
	
	
	
	//taal
	$('#taal_selected').click(
		function() {
			$('#taal_select').toggle();
		}
		);
		
	//eind

	// Add pdf icons to pdf links
	$("a[href$='.pdf']").addClass("pdf");
	 
	// Add txt icons to document links (doc, rtf, txt)
	$("a[href$='.doc'], a[href$='.txt'], a[href$='.rft']").addClass("txt");

	// Add zip icons to Zip file links (zip, rar)
	$("a[href$='.zip'], a[href$='.rar']").addClass("zip"); 
	
	// Add email icons to email links
	$("a[href^='mailto:']").addClass("email");

	//Add external link icon to external links - 
	$('a').filter(function() {
		//Compare the anchor tag's host name with location's host name
	    return this.hostname && this.hostname !== location.hostname;
	  }).addClass("external");

/*menu*/
	function megaHoverOver(){
		$(this).find(".sub").stop().fadeTo('fast', 1).show();
			
		//Calculate width of all ul's
		(function($) { 
			jQuery.fn.calcSubWidth = function() {
				rowWidth = 0;
				//Calculate row
				$(this).find("ul").each(function() {					
					rowWidth += $(this).width(); 
				});	
			};
		})(jQuery); 
		
		if ( $(this).find(".row").length > 0 ) { //If row exists...
			var biggestRow = 0;	
			//Calculate each row
			$(this).find(".row").each(function() {							   
				$(this).calcSubWidth();
				//Find biggest row
				if(rowWidth > biggestRow) {
					biggestRow = rowWidth;
				}
			});
			//Set width
			$(this).find(".sub").css({'width' :biggestRow});
			$(this).find(".row:last").css({'margin':'0'});
			
		} else { //If row does not exist...
			
			$(this).calcSubWidth();
			//Set Width
			$(this).find(".sub").css({'width' : rowWidth});
			
		}
	}
	
	function megaHoverOut(){ 
	  $(this).find(".sub").stop().fadeTo('fast', 0, function() {
		  $(this).hide(); 
	  });
	}
 
 
	var config = {    
		 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
		 interval: 100, // number = milliseconds for onMouseOver polling interval    
		 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
		 timeout: 500, // number = milliseconds delay before onMouseOut    
		 out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
	};
 
	$("ul#topnav2 li .sub").css({'opacity':'0'});
	$("ul#topnav2 li").hoverIntent(config);
 				
				
/*menu*/
	});
	
	
	
	
	

