/* Author: 

*/


$(document).ready(function() {
	
//$("#occasion-list li").click(function(){
//     window.location=$(this).find("ul li a").attr("href");
//     return false;
//	});

	
	$(".brands a").hover(function() {
        $(this).stop().animate({top: "-100"}, 140);
    }, function() {
        $(this).stop().animate({top: "0"}, 100);
    });
    
    $('#screen').serialScroll({
		target:'#sections',
		items:'li', // Selector to the items ( relative to the matched elements, '#sections' in this case )
		prev:'img.prev',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
		next:'img.next',// Selector to the 'next' button (absolute too)
		axis:'xy',// The default is 'y' scroll on both ways
		navigation:'#navigation li a',
		duration:400,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
		force:true, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
		
		//queue:false,// We scroll on both axes, scroll both at the same time.
		//event:'click',// On which event to react (click is the default, you probably won't need to specify it)
		stop:true,// Each click will stop any previous animations of the target. (false by default)
		lock:false, // Ignore events if already animating (true by default)		
		//start: 0, // On which element (index) to begin ( 0 is the default, redundant in this case )		
		cycle:true,// Cycle endlessly ( constant velocity, true is the default )
		step:1, // How many items to scroll each time ( 1 is the default, no need to specify )
		//jump:false, // If true, items become clickable (or w/e 'event' is, and when activated, the pane scrolls to them)
		//lazy:false,// (default) if true, the plugin looks for the items on each event(allows AJAX or JS content, or reordering)
		//interval:1000, // It's the number of milliseconds to automatically go to the next
		//constant:true, // constant speed
		
		onBefore:function( e, elem, $pane, $items, pos ){
			/**
			 * 'this' is the triggered element 
			 * e is the event object
			 * elem is the element we'll be scrolling to
			 * $pane is the element being scrolled
			 * $items is the items collection at this moment
			 * pos is the position of elem in the collection
			 * if it returns false, the event will be ignored
			 */
			 //those arguments with a $ are jqueryfied, elem isn't.
			e.preventDefault();
			if( this.blur )
				this.blur();
		},
		onAfter:function( elem ){
			//'this' is the element being scrolled ($pane) not jqueryfied
		}
	});
	
	$('#slider div.inner').nivoSlider({
        effect:'fade', // Specify sets like: 'fold,fade,sliceDown'
        slices:10, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed:500, // Slide transition speed
        pauseTime:3000, // How long each slide will show
        startSlide:0, // Set starting Slide (0 index)
        directionNav:false, // Next & Prev navigation
        controlNav:false, // 1,2,3... navigation
        keyboardNav:false, // Use left & right arrows
        captionOpacity:0.8
    });
    
    $("#commentForm").validate({
				submitHandler: function() {
				var naam     = $('#cname').attr('value');  
				var smail     = $('#cemail').attr('value');
				var curl   = $('#curl').attr('value');
				var telefoon  = $('#cphone').attr('value');
				var opmerking = $('#ccomment').attr('value');
                var adres =  $('#cadress').attr('value');
				
				$.ajax({  
						type: "POST",  
						url: "contactsend.php",  
						data: "naam="+ naam +"&smail="+ smail+"&curl="+ curl+"&telefoon="+ telefoon+"&opmerking="+ opmerking+"&adres="+ adres,  
						success: function(){  
							$('form#commentForm').hide(function(){$("#succes").show("fast");});
							
								 }  
						 });return false; 
				}
			});
    
    $("#insertemail").DefaultValue("Uw e-mailadres..");
    
    $('.gallery').click(function(e) {
          e.preventDefault();
	  $(this).next('#myModal').reveal();
     });
     
     $("#showcase").awShowcase(
	{
		content_width:			565,
		content_height:			300,
		fit_to_parent:			false,
		auto:					false,
		interval:				3000,
		continuous:				false,
		loading:				true,
		tooltip_width:			200,
		tooltip_icon_width:		32,
		tooltip_icon_height:	32,
		tooltip_offsetx:		18,
		tooltip_offsety:		0,
		arrows:					false,
		buttons:				false,
		btn_numbers:			false,
		keybord_keys:			true,
		mousetrace:				false, /* Trace x and y coordinates for the mouse */
		pauseonover:			true,
		stoponclick:			true,
		transition:				'hslide', /* hslide/vslide/fade */
		transition_delay:		300,
		transition_speed:		500,
		show_caption:			'onhover', /* onload/onhover/show */
		thumbnails:				true,
		thumbnails_position:	'outside-last', /* outside-last/outside-first/inside-last/inside-first */
		thumbnails_direction:	'horizontal', /* vertical/horizontal */
		thumbnails_slidex:		0, /* 0 = auto / 1 = slide one thumbnail / 2 = slide two thumbnails / etc. */
		dynamic_height:			true, /* For dynamic height to work in webkit you need to set the width and height of images in the source. Usually works to only set the dimension of the first slide in the showcase. */
		speed_change:			false, /* Set to true to prevent users from swithing more then one slide at once. */
		viewline:				false /* If set to true content_width, thumbnails, transition and dynamic_height will be disabled. As for dynamic height you need to set the width and height of images in the source. */
	});


	
});




















