// JavaScript Document

if($.cookie("css")) {

	$("link").attr("href",$.cookie("css"));

}



$(document).ready(function(){

	$('#social-icons li a,#logo').mouseenter(function(){

		$(this).stop().animate({'left':'5px'},100);

	}).mouseleave(function(){

		$(this).stop().animate({'left':'0px'},100);

	});

	

	$('#logo').mouseenter(function(){

		$(this).stop().animate({'top':'42px'},100);

	}).mouseleave(function(){

		$(this).stop().animate({'top':'0px'},100);

	});



	var newYear = new Date(); 

	newYear = new Date(newYear.getFullYear() + 1, 9 - 1, 7, 3);

	$('#months.countdown-item p').countdown({

		until: newYear, 

		format: 'yODHMS',

		layout: '{on}'

	});

	$('#days.countdown-item p').countdown({

		until: newYear, 

		format: 'ODHMS',

		layout: '{dn}'

	});

	$('#hours.countdown-item p').countdown({

		until: newYear, 

		format: 'ODHMS',

		layout: '{hn}'

	});

	$('#minutes.countdown-item p').countdown({

		until: newYear, 

		format: 'ODHMS',

		layout: '{mn}'

	});

	$('#seconds.countdown-item p').countdown({

		until: newYear, 

		format: 'ODHMS',

		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');

		});

	})

});
