/* Gallery Fade */
/*
jQuery(document).ready(function() {
	jQuery(".portfoliocontent").delegate(".portfolio-bigbox", "mouseover mouseout", function(e) {
		if (e.type == 'mouseover') {
		jQuery(".portfoliocontent .portfolio-bigbox").not(this).dequeue().animate({opacity: "0.3"}, 200);
    	} else {
		jQuery(".portfoliocontent .portfolio-bigbox").not(this).dequeue().animate({opacity: "1"}, 200);
   		}
	});
});*/

/* Anchor Links */

$(document).ready(function() {

	
	$('.spacer a').click(function(){
		$("html, body").animate({scrollTop:0},"slow");
	});

	$('#aboutlink').click(function(){
		$.scrollTo('#about', {duration: 1000});
	});

	$('#contactslink').click(function(){
		$.scrollTo('#contacts', {duration: 1000});
	});
	
	$('#portfoliolink').click(function(){
		$.scrollTo('#portfolio', {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() {
	$("#scrolltop").scrollToTop();
});

/* Nivo Slider */

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
	});
});

/* Fancy Box */
/*
$(document).ready(function() {
	$("a.fb").fancybox({});	
});
*/
jQuery(document).ready(function() {
  jQuery(".portfoliocontent").hide();
  //toggle the component with class msg_body
  jQuery(".portfolioheading").click(function()
  {
    jQuery(this).next(".portfoliocontent").slideToggle(500);
  });
});
