$(function(){
$(".back-to-top").click(function(){
  $('html,body').animate({
    scrollTop:0
  },1000);
})
var docky=0;
var navheight=$("#nav").height();
$("#docky").hide()
$("#icons").hide();
$("#docky").hover(
	function(){
		//$("#docky-button").height(40);
		$("#icons").slideDown("fast");
	},
	function(){
		//$("#docky-button").height(10);
		$("#icons").hide();
	}
)
$(".icon").hover(
	function(){
		$(this).addClass("hovered-icon");
	},
	function(){
		$(this).removeClass("hovered-icon");
	}
)
$(window).scroll(function(){
if ($(window).scrollTop()>navheight){
  if (docky==0){
      $("#docky").show();
    docky=1;
  }
}else{
  if(docky==1){
    $("#docky").hide();
    docky=0;
  }
}
})
$('#icon-search').colorbox({height:"100px", inline:true, href:"#searchform",onComplete:function(){$("#cboxLoadedContent > #searchform > #s").focus();}});
$('#icon-comment').colorbox({width:"800px",inline:true, href:"#icon-comment-html",onComplete:function(){$("#icon-comment-html > #respond > #commentform > .comment-form-comment > #comment").focus();}});
})


