jQuery(document).ready(function() {
	jQuery(".work-item").delegate(".work-content", "mouseover mouseout", function(e) {
		if (e.type == 'mouseover') {
		jQuery(".work-item .work-content").not(this).dequeue().animate({opacity: "0.3"}, 200);
    	} else {
		jQuery(".work-item .work-content").not(this).dequeue().animate({opacity: "1"}, 200);
   		}
	});
});

$(document).ready(function() {

	
	$('.divider a').click(function(){
		$("html, body").animate({scrollTop:0},"slow");
	});

	$('#link-section-info').click(function(){
		$.scrollTo('#section-info', {duration: 1000});
	});

	$('#link-section-work').click(function(){
		$.scrollTo('#section-work', {duration: 1000});
	});
	
	$('#link-section-contact').click(function(){
		$.scrollTo('#section-contact', {duration: 1000});
	});

	$('#link-section-clients').click(function(){
		$.scrollTo('#section-clients', {duration: 1000});
	});
	
	
	$.fn.scrollToTop=function(){
		$(this).hide().removeAttr("href");
		if($(window).scrollTop()!="0"){
			$(this).fadeIn("slow")
		}
		var scrollDiv=$(this);	
		$(window).scroll(function(){
			if($(window).scrollTop()=="0"){
				$(scrollDiv).fadeOut("slow")
			}else{
				$(scrollDiv).fadeIn("slow")
			}
		});			
		$(this).click(function(){
			$("html, body").animate({scrollTop:0},"slow");
		});
	}
}); 


$(function() {
	$("#scrollButton").scrollToTop();
});

jQuery(window).load(function() {
	jQuery('#slider').nivoSlider({
		effect:'fold',
		slices:5,
		animSpeed:350, //Slide transition speed
        pauseTime:4000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:true, //Next & Prev
        directionNavHide:true, //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
	});
});

jQuery(window).load(function() {
	jQuery('#sliderequipos').nivoSlider({
		effect:'fold',
		slices:5,
		animSpeed:350, //Slide transition speed
        pauseTime:4000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:true, //Next & Prev
        directionNavHide:true, //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
	});
});

$(document).ready(function() {
	$("a.fb").fancybox({});	
});
