

  $.fn.wait = function(time, type) {
        time = time || 1000;
        type = type || "fx";
        return this.queue(type, function() {
            var self = this;
            setTimeout(function() {
                $(self).dequeue();
            }, time);
        });
    };





$(function($) {
	

	$('#slider').nivoSlider({
		effect:'fade',
		slices:1,
		animSpeed:300,
		pauseTime:4000,
		controlNav:false,
		captionOpacity:0.9,
		controlNav:true,
		controlNavThumbs:true,
		controlNavThumbsSearch:  '300',
		controlNavThumbsReplace:  '100'
	});
	
	
	
	// Lightbox
	$('a.lightbox').lightBox({overlayOpacity: 0.7});

	
	$('form.success').slideUp(1000, function(){
		$('div#contact-form p.success').fadeTo('fast', 0.7, function(){
			$(this).fadeTo('fast', 1.0);
		});
	});
	

	$('.validation-error').animate({
		marginLeft: 0
	}, 800, function(){
		$(this).animate({
			marginLeft: 10
		}, 200, function(){
			$(this).animate({
				marginLeft: 0
			}, 200);
		});
	});
		
		
});




