var fluid_1_4=fluid_1_4||{};(function($,fluid){var NAMESPACE_KEY="fluid-scoped-data";fluid.getScopedData=function(target,key){var data=$(target).data(NAMESPACE_KEY);return data?data[key]:undefined};fluid.setScopedData=function(target,key,value){$(target).each(function(){var data=$.data(this,NAMESPACE_KEY)||{};data[key]=value;$.data(this,NAMESPACE_KEY,data)})};var lastFocusedElement=null;$(document).bind("focusin",function(event){lastFocusedElement=event.target});fluid.getLastFocusedElement=function(){return lastFocusedElement};var ENABLEMENT_KEY="enablement";fluid.enabled=function(target,state){target=$(target);if(state===undefined){return fluid.getScopedData(target,ENABLEMENT_KEY)!==false}else{$("*",target).add(target).each(function(){if(fluid.getScopedData(this,ENABLEMENT_KEY)!==undefined){fluid.setScopedData(this,ENABLEMENT_KEY,state)}else{if(/select|textarea|input/i.test(this.nodeName)){$(this).prop("disabled",!state)}}});fluid.setScopedData(target,ENABLEMENT_KEY,state)}};fluid.initEnablement=function(target){fluid.setScopedData(target,ENABLEMENT_KEY,true)};function applyOp(node,func){node=$(node);node.trigger("fluid-"+func);node[func]()}$.each(["focus","blur"],function(i,name){fluid[name]=function(elem){applyOp(elem,name)}})})(jQuery,fluid_1_4);