/* Author: 

*/

Cufon.replace('a.logo');
Cufon.replace('h1');
Cufon.replace('nav ul li a span', { autoDetect: true });


$(window).load(function() {
    $('#slider').nivoSlider({
        effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
        slices:10,
        animSpeed:500, //Slide transition speed
        pauseTime: 6000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:true, //Next & Prev
        directionNavHide:false, //Only show on hover
        controlNav:true, //1,2,3...
        controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', //Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav:true, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:false, //Force manual transitions
        captionOpacity:0.8, //Universal caption opacity
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){}, //Triggers after all slides have been shown
        lastSlide: function(){}, //Triggers when last slide is shown
        afterLoad: function(){} //Triggers when slider has loaded
    });
    
    $("a#video").fancybox({
		'titleShow'     : false,
		'padding'		: 0,
		'overlayColor'  : '#000000'
	});
	
	$('a.close').click(function() {
      $('.more-info').animate({ opacity: 0, height: 'toggle', paddingBottom: 0 });
      $(this).fadeOut('slow');
      $('a.open').fadeIn('slow');
    });
    
    $('a.open').click(function() {
      $('.more-info').animate({ opacity: 1, height: 'toggle', paddingBottom: 15 });
      $(this).fadeOut('slow');
      $('a.close').fadeIn('slow');
    });
    
    $('.info [title]').colorTip({color:'black'});
    
    $("#contactForm").validate({
				rules: {
					contactname: "required",
					contactemail: {
						required: true,
						email: true
					},
					contactmessage: "required"
				},
				submitHandler: function() {
				var naam     = $('#contactname').attr('value');  
				var smail     = $('#contactemail').attr('value');
				var bedrijf   = $('#contactcompany').attr('value');
				var telefoon  = $('#contactphone').attr('value');
				var opmerking = $('#contactmessage').attr('value');
				
				$.ajax({  
						type: "POST",  
						url: "contactsend.php",  
						data: "naam="+ naam +"& smail="+ smail+"& bedrijf="+ bedrijf+"& telefoon="+ telefoon+"& opmerking="+ opmerking,  
						success: function(){  
							$('form#contactForm').hide(function(){$("#succes").show("fast");});
							
								 }  
						 });return false; 
				},
				messages: {
					contactname: "Vul uw naam in",
					contactemail: "Vul een juist e-mailadres in",
					contactmessage: "Vul uw bericht in"
				}
			});
	
	
});





















