$(document).ready(function(){
  $('#newsletter-signup')
	.focus(function(){ if (this.value == 'Enter your email address') this.value = ''; })
	.blur(function(){ if (this.value == '') this.value = 'Enter your email address'; }); 
  
  $("#bottom-blocks > div").mouseover(function(){
    $(this).addClass("over");
  }).mouseout(function(){
    $(this).removeClass("over");
  });
  
  $("#bottom-blocks > div:nth-child(3n)").addClass('last');
  $("#bottom-blocks > div").click(function() {
    window.location = $(this).find("a").attr("href");
  });
  $("img.wcaption").each(function(i) {
    var imgwidth = $(this).width();
    var imgheight = $(this).height();
    var captiontext = $(this).attr('title');
    var alignment = $(this).attr('style');
    $(this).attr({align:""});
    $(this).wrap("<div class=\"image-caption-container\" style=\"" + alignment + "\"></div>");
    $(this).parent().width(imgwidth);
    $(this).parent().append("<div class=\"image-caption\">" + captiontext + "</div>");
  });

});

$(window).load(function(){
  
  var homeHeight = $("#bottom-blocks").height();
  $("#bottom-blocks .block-block").height(homeHeight);
  
  var sideHeight = $("#sidebar-right").height();
  var conHeight = $("#main-body").height();
  if (sideHeight > conHeight) {
    $("#main-body").height(sideHeight);
  }

});
 

