	$(document).ready(function() {
		
	fix_flash(); 
	
	 $('.slideshow_1').cycle({	fx: 'fade', speed: 2000, delay: 2000});
	 $('.slideshow_2').cycle({	fx: 'fade', speed: 1500, delay: 1500});
	 $('.slideshow_3').cycle({	fx: 'fade', speed: 2500, delay: 4000});
	 $('.slideshow_4').cycle({	fx: 'fade', speed: 1800, delay: 2500});	
				
	$(".gallery a[rel^='prettyPhoto']").prettyPhoto({
			theme:'facebook',
			overlay_gallery: false,
			deeplinking: false,
			social_tools: ''
			});
			
/*	$(".gallery a[rel^='catalogus']").prettyPhoto({
			theme:'facebook',
			overlay_gallery: false,
			callback: function() {
				<!--window.location.reload(true);-->
			},
			deeplinking: true,
			social_tools: ''
			});			
*/			
	$(".product img[title]").tooltip();			
	
	$('table.sortable tbody tr:odd').addClass('odd');
	
	$("#referenties").tabs("#referenties div.pane", {tabs: 'h2', effect: 'slide', initialIndex: null});
	
	$('div.expandable ul').expander({
		slicePoint:       0,  // default is 100
		expandPrefix:     ' ', // default is '... '
		expandText:       'lees meer...', // default is 'read more'
		collapseTimer:    0, // re-collapses after 5 seconds; default is 0, so no re-collapsing
		userCollapseText: '[^]'  // default is 'read less'
	  });
	
	/*banner-slide*/
	
	var interval = setInterval(function(){
	if(jQuery("#s1").length > 0) {
		clearInterval(interval); 
		jQuery('#s1').cycle({fx:'scrollDown', timeout: 5000}); 
	}
	}, 1);

	
/*validate*/

				$("#contactForm1").validate();
				
				$("#mijnGegevens").validate();
				
				$("#contactForm").validate();


/*				$("#contactForm").validate({
					rules: {
						Naam: {
							required: true,
						},
						Telefoon: {
							required: true,
							number: true,
							minlength: 10
						},
						Email: {
							required: true,
							email: true
						},
					},
					messages: {
						Naam: {
							required: '&nbsp;',
						},
						Telefoon: {
							required: '&nbsp;',
							number: 'Onuist',
							minlength: 'Min: 10'
						},
						Email: '&nbsp;',
						message: {
							required: '&nbsp;'
						}
					},
						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*/
	});
	
	
	
	
	

