$(function() {
    $('#slide ul').before('<div id="nav-slide">').cycle({
        fx:     'fade',
        pager:  '#nav-slide',
		timeout: 5000,
		before:	function() { 
			$('#percent').animate({ 'width' : '0%' }, 0).animate({ 'width' : '100%' }, 5000);
		},
		onPagerEvent: function() { 
			$('#percent').stop().animate({ 'width' : '0%' }, 0).animate({ 'width' : '100%' }, 5000);
		}
    });
});

$(document).ready(function(){
	// clear input on focus
	var clearMePrevious = '';
	$('.clearfield').focus(function()
	{
		if($(this).val()==$(this).attr('title'))
		{
			clearMePrevious = $(this).val();
			$(this).val('');
		}
	});
	$('.clearfield').blur(function()
	{
		if($(this).val()=='')
		{
			$(this).val(clearMePrevious);
		}
	});
	
	$('.lated-new ul,.lated-project ul').jcarousel({
		scroll: 1
    });
});

Cufon.replace('.title-slide');
