$(document).ready(function(){
	
	/* Colorbox galleries */
	$(".gallery").colorbox();
	
	$("#our_work a").colorbox({innerWidth:'900px', innerHeight:'600px'});
		
	/* Slide-out social media links */
	$('#social_open').click(function() {
		$('#social').animate({
		}, 1); 
    $('#social').slideDown('1000');   
		$('#social_open').fadeOut();
	});
	$('#social_close').click(function() {
		$('#social').slideUp('300');
		$('#social_open').delay('100').fadeIn();
	});

	/* Frames */
	$('#frame1').cycle({ 
			delay:  1500, 
			speed:  500
	}); 
	$('#frame2').cycle({ 
			delay:  800, 
			speed:  500
	}); 
	$('#frame3').cycle({ 
			delay:  3200, 
			speed:  500
	}); 
	$('#frame4').cycle({ 
			delay:  2200, 
			speed:  500
	}); 
	$('#frame5').cycle({ 
			delay:  1200, 
			speed:  500
	}); 
	$('#frame6').cycle({ 
			delay:  2700, 
			speed:  500
	}); 
	$('#frame7').cycle({ 
			delay:  3000, 
			speed:  500
	}); 
	
});

$('#our_work a').colorbox({onComplete:function(){
	/* Slideshow */
	// nivo.dev7studios.com
	// Effect Parameters: sliceDown, sliceDownLeft, sliceUp, sliceUpLeft, sliceUpDown, sliceUpDownLeft, fold, fade, random
	$('#slideshow').nivoSlider({
		effect:'sliceDown', //Specify sets like: 'fold,fade,sliceDown'
		slices:15,
		animSpeed:1000, //Slide transition speed
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:false, //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:false, //Use left & right arrows
		pauseOnHover:false, //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
	});
}});

/* Google Analytics code */
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-15934785-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
