/* Author: Matthew Pereira

*/

$(document).ready(function (){
	
	$("#main").galleria({ transition: 'fade', image_margin: 10, transition_speed: 500, carousel_speed: 1200, 
	
		extend: function(options) {

			var gallery = this; // "this" is the gallery instance

            $('#previousbutton').click(function() {

                gallery.prev(); // call the previous image

            });
            
            $('#nextbutton').click(function() {

                gallery.next(); // call the next image

            });
        }
        
	});
	
	$("#contactform").validate();
	
	$('#previousbutton, #nextbutton').delay(500).fadeIn(1500);
	$('#previousbutton').hover(function () {
	    $(this).stop().animate({ opacity: 1 }, 250);
	  },
	  function () {
	    $(this).stop().animate({ opacity: 0.5 }, 750);
	});
	$('#nextbutton').hover(function () {
	    $(this).stop().animate({ opacity: 1 }, 250);
	  },
	  function () {
	    $(this).stop().animate({ opacity: 0.5 }, 750);
	});
	
});
