$(document).ready(function() {

    //twitter odd
    $("#twitter-box p:odd").css("background-color", "#fff");
    
    //slideshow
    $('#slideshow-wrapper').cycle({ 
	fx:     'fade',
	timeout: 8000,
	next:   '#arrow-right', 
	prev:   '#arrow-left' 
    });
    
    //back to top
	$("#backtotop").hide();

	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 100) {
				$('#backtotop').fadeIn();
			} else {
				$('#backtotop').fadeOut();
			}
		});

		$('#backtotop img').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});
    
    //last blog entry
    $("#content section").last().css("margin-bottom", "0px");	
    
    //project overstate
    $(".project").hover(function() {
		$(this).children(".project-desc").fadeIn();
    }, function () {
		$(this).children(".project-desc").fadeOut();
    });
    
    //ipad fix
    if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
    {
	 $("#backtotop").css("position", "static");
    };
    
});
