
 function setContainerHeight(){
  $('.filler').height(0);
  var contentHeight = $('#left-column').height();
  var sidebarHeight = $('#right-column').height();
  if( sidebarHeight < contentHeight ){
    var fillerHeight = contentHeight - sidebarHeight - 10;
    $('#right-column .filler').height(fillerHeight).show();
  }else{
    var fillerHeight = sidebarHeight - contentHeight - 10;
    $('#left-column .filler').height(fillerHeight).show();
  }
}

$(function(){
  setContainerHeight();
  
  $(".has-children").hover(function(){
      $(this).addClass("hovered");
    },
    function(){
      $(this).removeClass("hovered");
    }  
  );
  
  $(".top-focus").hover(function(){
      $(".top-focus").removeClass("active");
      $(this).addClass("active");
    },
    function(){
      $(".top-focus").removeClass("active");
      if($("body").is('#coach-house')){
        $("#focus-coach-house").addClass("active");
      }else if($("body").is('#mansion')){
        $("#focus-mansion").addClass("active");
      }
    }  
  );
  
  $(".carousel li").hover(function(){
      $('.carousel').prepend($('#footer .zoom'));
    },
    function(){
      $('#footer').prepend($('.carousel .zoom'));
    }  
  );
  
  $(".top-focus").click(function(){
    $(this).find("a").each(function(){
  	  window.location = this.href
  	});
  });
  
  $('.enq-eml').attr('href', $.rotate13('znvygb:radhvevrf@tynafriva.pbz'))
               .text($.rotate13('radhvevrf@tynafriva.pbz'));
               
  $('.min-eml').attr('href', $.rotate13('znvygb:uneirlcrgref@zvareinpbafhygvat.pb.hx'))
         .text($.rotate13('uneirlcrgref@zvareinpbafhygvat.pb.hx'));
   
   $('#modal-book').jqm({modal: true, trigger: '.modal-book'}).jqmAddClose('.close-modal'); 
   $('#modal-360').jqm({modal: false}).jqmAddClose('.close-modal'); 
   $('#modal-floor').jqm({modal: false}).jqmAddClose('.close-modal'); 
   
   $('.show-floorplan').click(function(){
     var top = $(window).scrollTop() + 150;
     $('#modal-floor')
       .html('<img src="' + $(this).attr("href") + '" alt="Floor plan" class="floorplan" /><img src="img/icons/close.png" alt="Close Window" title="Close Window" class="close-modal"/>')
       .css("top", top)
       .jqmShow()
       .jqmAddClose('.close-modal');
     return false;
   });
});



