(function(b){var d=false,f="placeholder";if("placeholder" in document.createElement("input")){d=true}b(function(){var c=b("input:text[placeholder], textarea[placeholder]");if(!c.length){return}c.each(a);if(!d){b("form").submit(e)}});function a(){var c=b(this),g=c.attr("placeholder");c.bind("focus.placeholder",function(){if(!d){if(c.val()===g){c.val("");c.removeClass(f)}}else{c.removeClass(f)}}).bind("blur.placeholder",function(){if(!d){if(c.val()===""||c.val()===g){c.val(g);c.addClass(f)}}else{if(!c.val()){c.addClass(f)}}}).trigger("blur.placeholder")}function e(){var c=b(this);c.find("input:text[placeholder], textarea[placeholder]").each(function(){var g=b(this);if(g.val()===g.attr("placeholder")){g.val("")}})}})(jQuery);

;
(function ($) {
  Drupal.behaviors.redcat_adaptivetheme = {
    attach: function() {
      $('#redcat-datepicker td.ui-datepicker-current-day').parent().addClass('ui-datepicker-current-week');

      /* POSITIONING OF SIDEBAR */
      var contentHeight = $('#content').position();
      var main_contentHeight = $('#main-content').position();
      var tasksHeight = $('#tasks').outerHeight(true);
      var height = contentHeight.top + main_contentHeight.top - tasksHeight + 'px';
      $('.region-sidebar-first').css('margin-top', height);
      $('.page-type-redcat-general .region-sidebar-first').css('margin-top', '30px');
      
      /* Buy now button opens a window */
      $("a.buy-link-button").click(function() {
        window.open(this.href, 'order_window', 'scrollbars,width=860,height=600,status=yes,left='+((window.screen.width - 860)/2)+',top='+((window.screen.height - 600) /2.5))
        return false;
      });
    }
  }
})(jQuery);
;

