jQuery(document).ready(function($) {

	/*
	Setting and starting the counter. For more information on the available settings please visit:
	http://www.webmuse.co.uk/projects/jcountdown-jquery-plugin/
	- or -
	https://github.com/tomgrohl/jQuery-plugins
	*/

	$("#counter").countdown({
		date: "june 01, 2012", //Counting to this date
		onComplete: function( event ) {
			$(this).html("<div id='counter-days' class='counter-box'><div class='count'>D</div><span class='counter-type'>the</span></div><div id='counter-hours' class='counter-box'><div class='count'>O</div><span class='counter-type'>time</span></div><div id='counter-minutes' class='counter-box'><div class='count'>N</div><span class='counter-type'>has</span></div><div id='counter-seconds' class='counter-box'><div class='count'>E</div><span class='counter-type'>come</span></div>");
			$('.soon').html("We<br />are<br />ready!");
		}
	});

	/*
	Setting up tipsy enabled elements. For more information on the available settings please visit:
	http://onehackoranother.com/projects/jquery/tipsy/
	*/

	$('.social-media a').tipsy({gravity: 's', opacity: 0.9, fade: true});

	/*
	Setting up fancyBox enabled thumbnail. For more information on the available settings please visit:
	http://fancyapps.com/fancybox/
	*/

	$(".thumbnail").fancybox({
    	openEffect	: 'elastic',
    	openEasing : 'easeOutBack',
    	
    	closeEffect	: 'elastic',
		closeEasing : 'easeInBack',

    	helpers : {
    		title : {
    			type : 'inside'
    		}
    	}
    });


	/*
	Setting up template effects and animations
	*/

	$('#counter').hover(
		function () {
			$(this).stop().fadeTo(300, 0.5);
		},
		function() {
			$(this).stop().fadeTo(200, 1);
		}
	);
	$('#strip').hover(
		function () {
		    $('.bigtype').stop().animate({color: '#fff'}, 700);
			$('.soon').stop().animate({top: '-150', opacity: 0}, 200);
		},
		function() {
		    $('.bigtype').stop().animate({color: '#888'}, 700);
			$('.soon').stop().animate({top: '0', opacity: 1}, 200);
		}
	);
	$('.social-media a').hover(
		function () {
			$(this).stop().fadeTo(300, 0.5);
		},
		function() {
			$(this).stop().fadeTo(200, 1);
		}
	);
	$('.thumbnail').hover(
		function () {
			$(this).stop().fadeTo(300, 0.8);
		},
		function() {
			$(this).stop().fadeTo(200, 1);
		}
	);
});
