// JavaScript Document
if($.cookie("css")) {
	$("link").attr("href",$.cookie("css"));
}

$(document).ready(function(){
	$('#social-icons li a').mouseenter(function(){
		$(this).stop().animate({'left':'5px'},100);
	}).mouseleave(function(){
		$(this).stop().animate({'left':'0px'},100);
	});

	var newYear = new Date(); 
	newYear = new Date(newYear.getFullYear() + 0, 5-1, 18);
	
	$('#days.countdown-item p').countdown({
		until: newYear, 
		format: 'DHMS',
		layout: '{dn}'
	});
	$('#hours.countdown-item p').countdown({
		until: newYear, 
		format: 'DHMS',
		layout: '{hn}'
	});
	$('#minutes.countdown-item p').countdown({
		until: newYear, 
		format: 'DHMS',
		layout: '{mn}'
	});
	$('#seconds.countdown-item p').countdown({
		until: newYear, 
		format: 'DHMS',
		layout: '{sn}'
	});


	$("#theme-colour a").click(function() {
		var cssLink = $(this).attr('href');
		$("div").fadeOut(1000,function(){
			$("link").attr("href",cssLink);
			$.cookie("css",cssLink, {expires: 365, path: '/'});
			location.reload(true);

		});
		return false;
	});
	
	$('input.textbox').each(function(){
		$(this).example(function() {
		  return $(this).attr('title');
		});
	})
});
