$('#more').toggle(function() {
  $('.copy', '#middle').height(600);
  $('p', '#middle').height(600);
  $('.myhidden', '#middle').show();
  $(this).html("Read less");
}, function() {
  $('.copy', '#middle').height(188);
  $('p', '#middle').height(188);
  $('.myhidden', '#middle').hide();
  $(this).html("Read more");
});

$("#submit").click(function() {
	$.post("data/contact.php", $("form").serialize()).success(function() {
		alert("Thanks!");
		$('form :input').val("");
	});
});

$("a", "nav").hover(function() {
	var img = $("img", $(this));
	img.attr('src', img.attr('src').replace('off.','on.'));
}, function() {
	var img = $("img", $(this));
	img.attr('src', img.attr('src').replace('on.','off.'));
});

$("a#home").click(function() {
	$("html, body").animate({scrollTop:0}, 'slow');
});

$("a#about").click(function() {
	var y = $("div#middle").position().top - 140;
	$("html, body").animate({scrollTop:y}, 'slow');
});

$("a#contact").click(function() {
	var y = $("div#bottom").position().top;
	$("html, body").animate({scrollTop:y}, 'slow');
});

function fader() {
	console.log(1);
	$('#fader img:visible:eq(0)').fadeOut(4000).hide(0, function() {
	console.log(2);
		$(this).siblings('img').fadeIn(4000).show();
	});
}
$(document).ready(function() {
	$('#fader img:eq(1)').hide();
	var t=setInterval("fader();",10000);
});
