$(document).ready(function() {
	 $.preloadCssImages();

	
	// Slider
	$('#slider').nivoSlider({ 
			pauseTime:5000, 
			pauseOnHover:true,
			effect:'fade', //Specify sets like: 'fold,fade,sliceDown, random'
			directionNav:false
	});
						   
	// Fancybox						   	
	$("a[rel=work]").fancybox({
			'titlePosition' : 'over',
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'      : 'easeOutBack',
		'easingOut'     : 'easeInBack'
	});	
	
	// Fancybox						   	
	$(".services a").fancybox({
		'modal' : true,
		'autoDimensions' : false,
		'width' : 300


	});	

	// Target _blank
	$('#work a[href^="http://"]')
	  .attr({
		target: "_blank", 
		title: "View Site (Opens in a new window)"
	  });
	  
	//Smooth Scroll
	$('a.scroll, #top ul li a').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
		&& location.hostname == this.hostname) {
		var $target = $(this.hash);
		$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
		if ($target.length) {
			var targetOffset = $target.offset().top;
			$('html,body').animate({scrollTop: targetOffset}, 1000);
			return false;
		}
		}
	});
	
	
	// Tweets
	$("#twiiterBox").getTwitter({
		userName: "c3web",
		numTweets: 1,
		loaderText: "Loading tweets...",
		slideIn: true,
		slideDuration: 750,
		showTimestamp: true
	});


	
	   $('#pager ul').cycle({
			fx: 'fade',
			pager:  '#nav',
			delay: -1000,
			timeout: 50000,
			pause:1 
		});
		$('#commentsSlide ul').cycle({
			fx: 'fade',
			timeout:6000,
			delay: 2000			
		});


	  
});



