$(function () {
	$("#javaprompt").hide();
});

$(document).ready(function() {
	
	if($("#disqus_thread").is(":visible")) {
		$(".post").css("display", "block");
	}
	
	$('input[type=text]').focus(function() {
		$(this).val('');
	});
	
	$("img").lazyload({
		placeholder : "http://etzolin.com/tumblr/trans.png",
		effect      : "fadeIn"
	});
	
	if($(".post:hidden")) {
		$(".post").animate({ "height": "toggle", "opacity": "toggle" }, "slow");
	}
	
	$("#top").click(function(){
		$('html, body').animate({scrollTop:0}, 'slow');
	});
	
	$("#top").hover(
		function() {
			$(this).animate({
				opacity: 1
			}, 250);
		},
		function() {
			$(this).animate({
				opacity: 0.45
			}, 250);
		}
	);
	
	var top = $(document.body).children(0).position().top;
	var displayed = false;
	var scroll_timer;
	
	$(window).scroll(function () {
		if ($(this).scrollTop() > 100) {
			$('#top').fadeIn("slow");
		} else {
			$('#top').fadeOut("slow");
		}
	});

	$("#tumblr_controls").hover(
		function() {
			$(this).animate({
				height  : toggle,
				opacity : toggle
			}, 150);
		},
		function() {
			$(this).animate({
				height  : toggle,
				opacity : toggle
			}, 150);
		}
	);
	
});
