/*
 * jQuery WidowFix Plugin
 * http://matthewlein.com/widowfix/
 * Copyright (c) 2011 Matthew Lein
 * Version: 1.3.1 (2/09/2011)
 * Dual licensed under the MIT and GPL licenses
 * Requires: jQuery v1.4 or later
 */

(function(a){jQuery.fn.widowFix=function(d){var c={letterLimit:null,prevLimit:null,linkFix:false};var b=a.extend(c,d);return this.each(function(){var i=a(this),m;if(b.linkFix){var h=i.find("a:last");h.wrap("<var>");var e=a("var").html();m=h.contents()[0];h.contents().unwrap();}var f=a(this).html().split(" "),k=f.pop();if(f.length<=1){return;}function j(){if(k===""){k=f.pop();j();}}j();var l=f[f.length-1];if(b.linkFix){if(b.letterLimit!==null&&m.length>=b.letterLimit){i.find("var").each(function(){a(this).contents().replaceWith(e);a(this).contents().unwrap();});return;}else{if(b.prevLimit!==null&&l.length>=b.prevLimit){i.find("var").each(function(){a(this).contents().replaceWith(e);a(this).contents().unwrap();});return;}}}else{if(b.letterLimit!==null&&k.length>=b.letterLimit){return;}else{if(b.prevLimit!==null&&l.length>=b.prevLimit){return;}}}var g=f.join(" ")+"&nbsp;"+k;i.html(g);if(b.linkFix){i.find("var").each(function(){a(this).contents().replaceWith(e);a(this).contents().unwrap();});}});};})(jQuery);;
(function ($, Drupal, undefined) {

  Drupal.behaviors.palantirnet_theme = {
    attach: function (context, settings) {
      // specs for jQuery Widow fix: http://matthewlein.com/widowfix
  	  $('h1, h2, h3, h4, p').widowFix({
  	    letterLimit: 10
      });
    }
  }
  
})(jQuery, Drupal);
;

